diff options
author | Xavier Coulon | 2016-01-29 15:56:46 +0000 |
---|---|---|
committer | Jeff Johnston | 2016-02-05 19:38:39 +0000 |
commit | 085fe4fca3ee785586fb51612182f5c25afa177d (patch) | |
tree | 5cde3e02d647ea76b42354b47e0546e3a8755816 /containers/org.eclipse.linuxtools.docker.core | |
parent | 3414343c299e65a33a928987879869c99863d08d (diff) | |
download | org.eclipse.linuxtools-085fe4fca3ee785586fb51612182f5c25afa177d.tar.gz org.eclipse.linuxtools-085fe4fca3ee785586fb51612182f5c25afa177d.tar.xz org.eclipse.linuxtools-085fe4fca3ee785586fb51612182f5c25afa177d.zip |
Bug 486463 - SWTException below DockerImagesView$8.run
Unregister the Docker Images View as an image listener when
the view is disposed.
Preventing refreshing the view when the table widget is disposed
Preventing NPE when iterating on images and containers listeners
Added SWTBot tests
Change-Id: I45355965a236bddfb8720e7872391a4f50701fdc
Signed-off-by: Xavier Coulon <xcoulon@redhat.com>
Reviewed-on: https://git.eclipse.org/r/65567
Tested-by: Hudson CI
Reviewed-by: Jeff Johnston <jjohnstn@redhat.com>
Reviewed-on: https://git.eclipse.org/r/66040
Diffstat (limited to 'containers/org.eclipse.linuxtools.docker.core')
-rw-r--r-- | containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnection.java | 12 |
1 files changed, 10 insertions, 2 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 9bd6dbe463..d4b1eae364 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 @@ -342,8 +342,9 @@ public class DockerConnection implements IDockerConnection, Closeable { @Override public void removeContainerListener(IDockerContainerListener listener) { - if (containerListeners != null) + if (containerListeners != null) { containerListeners.remove(listener); + } } /** @@ -385,6 +386,9 @@ public class DockerConnection implements IDockerConnection, Closeable { */ // TODO: include in IDockerConnection API public List<IDockerContainerListener> getContainerListeners() { + if (this.containerListeners == null) { + return Collections.emptyList(); + } final IDockerContainerListener[] result = new IDockerContainerListener[this.containerListeners .size()]; final Object[] listeners = containerListeners.getListeners(); @@ -682,8 +686,9 @@ public class DockerConnection implements IDockerConnection, Closeable { @Override public void removeImageListener(IDockerImageListener listener) { - if (imageListeners != null) + if (imageListeners != null) { imageListeners.remove(listener); + } } public void notifyImageListeners(List<IDockerImage> list) { @@ -700,6 +705,9 @@ public class DockerConnection implements IDockerConnection, Closeable { */ // TODO: include in IDockerConnection API public List<IDockerImageListener> getImageListeners() { + if (this.imageListeners == null) { + return Collections.emptyList(); + } final IDockerImageListener[] result = new IDockerImageListener[this.imageListeners .size()]; final Object[] listeners = imageListeners.getListeners(); |