Fix NoSuchElementException

Change-Id: I2c80400d10dffd7dfda777de5279135ae687af35
diff --git a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/DefaultRoutingHandler.java b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/DefaultRoutingHandler.java
index 0d263e7..709d05e 100644
--- a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/DefaultRoutingHandler.java
+++ b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/DefaultRoutingHandler.java
@@ -244,6 +244,11 @@
      */
     // XXX refactor
     protected void populateSubnet(Set<ConnectPoint> cpts, Set<IpPrefix> subnets) {
+        if (cpts == null || cpts.size() < 1 || cpts.size() > 2) {
+            log.warn("Skipping populateSubnet due to illegal size of connect points. {}", cpts);
+            return;
+        }
+
         lastRoutingChange = DateTime.now();
         statusLock.lock();
         try {