From b3dbbaca76856eb753c46a9768006961f5abbe1b Mon Sep 17 00:00:00 2001 From: Greg Watson Date: Wed, 24 Sep 2014 09:15:44 -0400 Subject: [PATCH] Add check to prevent possible NPE Change-Id: I5e653f8e32484f6bcda5d13f78b1b3c712cf888c Signed-off-by: Greg Watson --- .../org/eclipse/remote/core/RemoteServicesUtils.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/bundles/org.eclipse.remote.core/src/org/eclipse/remote/core/RemoteServicesUtils.java b/bundles/org.eclipse.remote.core/src/org/eclipse/remote/core/RemoteServicesUtils.java index 9ce78756b0f..d441997cd61 100644 --- a/bundles/org.eclipse.remote.core/src/org/eclipse/remote/core/RemoteServicesUtils.java +++ b/bundles/org.eclipse.remote.core/src/org/eclipse/remote/core/RemoteServicesUtils.java @@ -123,9 +123,15 @@ public class RemoteServicesUtils { conn = services.getConnectionManager().getConnection(connName); } else if (connName != null) { for (RemoteServicesDescriptor proxy : RemoteServicesImpl.getRemoteServiceDescriptors()) { - conn = proxy.getServices().getConnectionManager().getConnection(connName); - if (conn != null) { - break; + services = proxy.getServices(); + if (services != null) { + IRemoteConnectionManager connMgr = services.getConnectionManager(); + if (connMgr != null) { + conn = connMgr.getConnection(connName); + if (conn != null) { + break; + } + } } } }