From: Tuukka Lehtonen Date: Mon, 17 Dec 2018 09:25:30 +0000 (+0200) Subject: Fixed NPE from Activator X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F56%2F2556%2F2;p=simantics%2Fdistrict.git Fixed NPE from Activator gitlab #25 Change-Id: Ib4c2f6534ebdf09129f1491578f0d2df86e9b6cf --- diff --git a/org.simantics.district.route/src/org/simantics/district/route/internal/Activator.java b/org.simantics.district.route/src/org/simantics/district/route/internal/Activator.java index f26d0cd7..e628862b 100644 --- a/org.simantics.district.route/src/org/simantics/district/route/internal/Activator.java +++ b/org.simantics.district.route/src/org/simantics/district/route/internal/Activator.java @@ -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