Merge pull request #590 from eclipse/fixNPE

fix NPE because of incorrect usage of firstNonNull
6.19.x
Alexander Garagatyi 2016-03-01 12:43:52 +02:00
commit bfcce52af5
1 changed files with 2 additions and 5 deletions

View File

@ -19,8 +19,6 @@ import org.eclipse.che.plugin.docker.machine.DockerInstanceRuntimeInfo;
import javax.inject.Inject;
import javax.inject.Named;
import static com.google.common.base.MoreObjects.firstNonNull;
/**
* Gets predefined docker containers host for machine servers instead of evaluating it from docker configuration
*
@ -41,8 +39,7 @@ public class LocalDockerInstanceRuntimeInfo extends DockerInstanceRuntimeInfo {
public LocalDockerInstanceRuntimeInfo(@Assisted ContainerInfo containerInfo,
@Assisted String containerHost,
@Nullable @Named("machine.docker.local_node_host") String dockerNodeHost) {
super(containerInfo, firstNonNull(firstNonNull(dockerNodeHost,
System.getenv(CHE_DOCKER_MACHINE_HOST)),
containerHost));
super(containerInfo, dockerNodeHost != null ? dockerNodeHost :
(System.getenv(CHE_DOCKER_MACHINE_HOST) != null ? System.getenv(CHE_DOCKER_MACHINE_HOST) : containerHost));
}
}