Fix an NPE in modified when calling hostHandler

Change-Id: Ifa8799875f8de8c5b322e773748b5f8caee8f97a
diff --git a/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java b/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java
index fff627f..d121cff 100644
--- a/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java
+++ b/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java
@@ -473,6 +473,18 @@
                 .withTimestampProvider((k, v) -> new WallClockTimestamp())
                 .build();
 
+        processor = new InternalPacketProcessor();
+        linkListener = new InternalLinkListener();
+        deviceListener = new InternalDeviceListener();
+        appCfgHandler = new AppConfigHandler(this);
+        mcastHandler = new McastHandler(this);
+        hostHandler = new HostHandler(this);
+        linkHandler = new LinkHandler(this);
+        routeHandler = new RouteHandler(this);
+        neighbourHandler = new SegmentRoutingNeighbourDispatcher(this);
+        l2TunnelHandler = new DefaultL2TunnelHandler(this);
+        topologyHandler = new TopologyHandler(this);
+
         compCfgService.preSetProperty("org.onosproject.net.group.impl.GroupManager",
                                       "purgeOnDisconnection", "true", false);
         compCfgService.preSetProperty("org.onosproject.net.flow.impl.FlowRuleManager",
@@ -503,18 +515,6 @@
         compCfgService.registerProperties(getClass());
         modified(context);
 
-        processor = new InternalPacketProcessor();
-        linkListener = new InternalLinkListener();
-        deviceListener = new InternalDeviceListener();
-        appCfgHandler = new AppConfigHandler(this);
-        mcastHandler = new McastHandler(this);
-        hostHandler = new HostHandler(this);
-        linkHandler = new LinkHandler(this);
-        routeHandler = new RouteHandler(this);
-        neighbourHandler = new SegmentRoutingNeighbourDispatcher(this);
-        l2TunnelHandler = new DefaultL2TunnelHandler(this);
-        topologyHandler = new TopologyHandler(this);
-
         cfgService.addListener(cfgListener);
         cfgService.registerConfigFactory(deviceConfigFactory);
         cfgService.registerConfigFactory(appConfigFactory);