Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Coulon2016-03-17 09:55:04 +0000
committerJeff Johnston2016-03-18 12:57:34 +0000
commit1357abc50c2a31b099db88cd35bf1f0eda193b16 (patch)
treedbf34b7634e0c12041991a599fc32de9eb06a564 /containers/org.eclipse.linuxtools.docker.core/src/org/eclipse
parentb3c86ece372cd795f386ce64319395b5f08ce4f9 (diff)
downloadorg.eclipse.linuxtools-1357abc50c2a31b099db88cd35bf1f0eda193b16.tar.gz
org.eclipse.linuxtools-1357abc50c2a31b099db88cd35bf1f0eda193b16.tar.xz
org.eclipse.linuxtools-1357abc50c2a31b099db88cd35bf1f0eda193b16.zip
Bug 488976 - NullPointer in DockerConnection.hasImage
Making sure that the returned list of images and the 'images' field in the DockerConnection class are not null after a call to DockerConnection#getImages(boolean) Change-Id: I51fef0c350a2d71c0abda108773eb5c070123b24 Signed-off-by: Xavier Coulon <xcoulon@redhat.com> Reviewed-on: https://git.eclipse.org/r/68654 Tested-by: Hudson CI Reviewed-by: Jeff Johnston <jjohnstn@redhat.com> Reviewed-on: https://git.eclipse.org/r/68723
Diffstat (limited to 'containers/org.eclipse.linuxtools.docker.core/src/org/eclipse')
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnection.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnection.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnection.java
index 4d689ef9d3..ecd04fb7e3 100644
--- a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnection.java
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnection.java
@@ -757,6 +757,13 @@ public class DockerConnection implements IDockerConnection, Closeable {
this.imagesLoaded = true;
}
}
+ // avoid returning a 'null' list.
+ if (this.images == null) {
+ this.images = Collections.emptyList();
+ }
+ if (latestImages == null) {
+ latestImages = Collections.emptyList();
+ }
return latestImages;
}
@@ -1378,6 +1385,7 @@ public class DockerConnection implements IDockerConnection, Closeable {
client.commitContainer(id, repo, tag, info.config(), comment,
author);
// update images list
+ // FIXME: are we refreshing the list of images twice ?
listImages();
getImages(true);
} catch (com.spotify.docker.client.DockerRequestException e) {

Back to the top