Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Coulon2016-11-07 14:02:08 +0000
committerRoland Grunberg2016-11-18 16:32:55 +0000
commitcdfc00c8f1764a3dfe4a8a9943d074b7d7818dcc (patch)
treef87480d221bf3543e99655fa9d124ec25e77a185
parentf24c9fa52ec1b412e5abc92b71027b62ff6b062d (diff)
downloadorg.eclipse.linuxtools-cdfc00c8f1764a3dfe4a8a9943d074b7d7818dcc.tar.gz
org.eclipse.linuxtools-cdfc00c8f1764a3dfe4a8a9943d074b7d7818dcc.tar.xz
org.eclipse.linuxtools-cdfc00c8f1764a3dfe4a8a9943d074b7d7818dcc.zip
Bug 507154 - NullPointerException in DockerConnectionManager.findConnection
Preventing NPE if the connection name is null. Change-Id: I5cdcafb75b76be4d3fd8b993b448ddf2b94d5d1e Signed-off-by: Xavier Coulon <xcoulon@redhat.com> Reviewed-on: https://git.eclipse.org/r/84575 Tested-by: Hudson CI Reviewed-by: Roland Grunberg <rgrunber@redhat.com>
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerConnectionManager.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerConnectionManager.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerConnectionManager.java
index 40d23b3092..aed586beef 100644
--- a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerConnectionManager.java
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerConnectionManager.java
@@ -94,7 +94,7 @@ public class DockerConnectionManager {
/**
* @return an unmodifiable and non-null array of {@link IDockerConnection}
*/
- public IDockerConnection[] getConnections() {
+ public IDockerConnection[] getConnections() {
if (this.connections == null) {
return new IDockerConnection[0];
}
@@ -171,7 +171,8 @@ public class DockerConnectionManager {
public IDockerConnection findConnection(final String name) {
if (name != null) {
for (IDockerConnection connection : connections) {
- if (connection.getName().equals(name))
+ if (connection.getName() != null
+ && connection.getName().equals(name))
return connection;
}
}

Back to the top