From c09dc875be3da5b5382833215563b442e9ceb297 Mon Sep 17 00:00:00 2001 From: Tuukka Lehtonen Date: Mon, 17 Dec 2018 11:25:30 +0200 Subject: [PATCH] Fixed NPE from Activator gitlab #25 Change-Id: Ib4c2f6534ebdf09129f1491578f0d2df86e9b6cf --- .../org/simantics/district/route/internal/Activator.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 -- 2.47.1