diff --git a/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/mcast/McastHandler.java b/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/mcast/McastHandler.java
index 584e51d..44a600c 100644
--- a/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/mcast/McastHandler.java
+++ b/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/mcast/McastHandler.java
@@ -56,6 +56,7 @@
 import org.onosproject.store.serializers.KryoNamespaces;
 import org.onosproject.store.service.ConsistentMap;
 import org.onosproject.store.service.Serializer;
+import org.onosproject.store.service.Versioned;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -1107,7 +1108,12 @@
                          source, mcastIp);
                 return;
             }
-            ingressTransitPorts.put(source, ingressTransitPort(mcastIp, ingressDevice, source));
+            Set<PortNumber> ingressTransitPort = ingressTransitPort(mcastIp, ingressDevice, source);
+            if (ingressTransitPort.isEmpty()) {
+                log.warn("No transit ports to remove on device {}", ingressDevice);
+                return;
+            }
+            ingressTransitPorts.put(source, ingressTransitPort);
         });
         ingressTransitPorts.forEach((source, ports) -> ports.forEach(ingressTransitPort -> {
             DeviceId ingressDevice = ingressDevices.stream()
@@ -1593,8 +1599,14 @@
                                                ConnectPoint source) {
         ImmutableSet.Builder<PortNumber> portBuilder = ImmutableSet.builder();
         if (ingressDevice != null) {
-            NextObjective nextObj = mcastNextObjStore.get(new McastStoreKey(mcastIp, ingressDevice,
-                                                            mcastUtils.assignedVlan(source))).value();
+            Versioned<NextObjective> nextObjVers = mcastNextObjStore.get(new McastStoreKey(mcastIp, ingressDevice,
+                                                                          mcastUtils.assignedVlan(source)));
+            if (nextObjVers == null) {
+                log.warn("Absent next objective for {}", new McastStoreKey(mcastIp, ingressDevice,
+                        mcastUtils.assignedVlan(source)));
+                return portBuilder.build();
+            }
+            NextObjective nextObj = nextObjVers.value();
             Set<PortNumber> ports = mcastUtils.getPorts(nextObj.next());
             // Let's find out all the ingress-transit ports
             for (PortNumber port : ports) {
