]> gerrit.simantics Code Review - simantics/district.git/commitdiff
Fixed NPE from Activator 56/2556/2
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Mon, 17 Dec 2018 09:25:30 +0000 (11:25 +0200)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Mon, 17 Dec 2018 09:26:24 +0000 (11:26 +0200)
gitlab #25

Change-Id: Ib4c2f6534ebdf09129f1491578f0d2df86e9b6cf

org.simantics.district.route/src/org/simantics/district/route/internal/Activator.java

index f26d0cd75c829ba2277dac55b47dd36f9d96d5d9..e628862bd512ae6c0fa3088e791952b44ddbe41e 100644 (file)
@@ -51,8 +51,10 @@ public class Activator implements BundleActivator, ServiceListener {
         // Register initially availble routers
         routerTracker = new ServiceTracker<>(context, Router.class.getName(), null);
         routerTracker.open();
-        for (Object router : routerTracker.getServices()) {
-            routeService.registerRouter((Router) router);
+        Object[] routers = routerTracker.getServices();
+        if (routers != null) {
+            for (Object router : routers)
+                routeService.registerRouter((Router) router);
         }
 
         // have a service listener to implement the whiteboard pattern