Avoid NPEs when services (like TRK) go missing
authorEd Swartz <ed.swartz@nokia.com>
Wed, 08 Sep 2010 17:13:42 -0500
changeset 1966 67581ab567b1
parent 1965 0dd7f79ee65d
child 1967 86b9e2a7db20
Avoid NPEs when services (like TRK) go missing
connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/internal/registry/Registry.java
--- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/internal/registry/Registry.java	Wed Sep 08 17:12:10 2010 -0500
+++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/internal/registry/Registry.java	Wed Sep 08 17:13:42 2010 -0500
@@ -211,8 +211,10 @@
 
 	public Collection<String> getCompatibleConnectionTypeIds(IService service) {
 		Collection<String> compatibleConnectionTypeIds = new HashSet<String>();
-		for (IConnectedServiceFactory factory : connectedServiceFactories) {
-			compatibleConnectionTypeIds.addAll(factory.getCompatibleConnectionTypeIds(service));
+		if (service != null) {
+			for (IConnectedServiceFactory factory : connectedServiceFactories) {
+				compatibleConnectionTypeIds.addAll(factory.getCompatibleConnectionTypeIds(service));
+			}
 		}
 		return compatibleConnectionTypeIds;
 	}