NEW - bug 420433: [r-OSGi] NPE in
ch.ethz.iks.r_osgi.impl.ChannelEndpointImpl.handleMessage(RemoteOSGiMessage)
when SERVICE_MODIFIED received before SERVICE_ADDED 
https://bugs.eclipse.org/bugs/show_bug.cgi?id=420433
diff --git a/protocols/bundles/ch.ethz.iks.r_osgi.remote/src/main/java/ch/ethz/iks/r_osgi/impl/ChannelEndpointImpl.java b/protocols/bundles/ch.ethz.iks.r_osgi.remote/src/main/java/ch/ethz/iks/r_osgi/impl/ChannelEndpointImpl.java
index 933184a..87896fb 100644
--- a/protocols/bundles/ch.ethz.iks.r_osgi.remote/src/main/java/ch/ethz/iks/r_osgi/impl/ChannelEndpointImpl.java
+++ b/protocols/bundles/ch.ethz.iks.r_osgi.remote/src/main/java/ch/ethz/iks/r_osgi/impl/ChannelEndpointImpl.java
@@ -1091,6 +1091,13 @@
 				}
 
 				final RemoteServiceReferenceImpl ref = getRemoteReference(serviceURI); //$NON-NLS-1$
+				// If r-OSGi receives a SERVICE_MODIFIED for service X before it
+				// knows about X (SERVICE_ADDED), there is no point in updating
+				// the local service instance. It will fail with an NPE anyway.
+				// (see https://bugs.eclipse.org/420433)
+				if (ref == null && reg == null) {
+					return null;
+				}
 				ref.setProperties(properties);
 				RemoteOSGiServiceImpl
 						.notifyRemoteServiceListeners(new RemoteServiceEvent(