Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Grunberg2016-02-25 20:22:09 +0000
committerRoland Grunberg2016-03-17 20:29:03 +0000
commit2f14489bdeadff11bb16b9e210fa19f91febc361 (patch)
treec07f7b3d3ed709932b57b74b566af2af41187462 /containers/org.eclipse.linuxtools.docker.core/src/org/eclipse
parentaee032f713f786fcce193b4f14688be13e557d4b (diff)
downloadorg.eclipse.linuxtools-2f14489bdeadff11bb16b9e210fa19f91febc361.tar.gz
org.eclipse.linuxtools-2f14489bdeadff11bb16b9e210fa19f91febc361.tar.xz
org.eclipse.linuxtools-2f14489bdeadff11bb16b9e210fa19f91febc361.zip
Prevent NPE when an image has no repoTags.
Change-Id: I79b6a1457a66b5c8d5f62d318f78cd06fed564cc Reviewed-on: https://git.eclipse.org/r/67368 Tested-by: Hudson CI Reviewed-by: Xavier Coulon <xcoulon@redhat.com> Reviewed-on: https://git.eclipse.org/r/68699 Reviewed-by: Roland Grunberg <rgrunber@redhat.com>
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.java3
1 files changed, 3 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 d4b1eae364..4d689ef9d3 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
@@ -807,6 +807,9 @@ public class DockerConnection implements IDockerConnection, Closeable {
final List<String> repoTags = new ArrayList<>(
rawImage.repoTags());
Collections.sort(repoTags);
+ if (repoTags.isEmpty()) {
+ repoTags.add("<none>:<none>"); //$NON-NLS-1$
+ }
final String repo = DockerImage.extractRepo(repoTags.get(0));
final List<String> tags = Arrays
.asList(DockerImage.extractTag(repoTags.get(0)));

Back to the top