Fixed Blocker issue in DRRouterCLI.java

https://sonar.onap.org/project/issues?id=org.onap.dmaap.datarouter%3Aparent&open=AWHFaQoPEU5FCDfKtnWE&resolved=false&severities=BLOCKER&types=BUG

Issue-ID: DMAAP-720
Change-Id: I450ec9604fd5fa4f4c9f21a275f9de94ccc6ad09
Signed-off-by: Amaresh Kumar <kamaresh@in.ibm.com>
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/DRRouteCLI.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/DRRouteCLI.java
index 1bbf446..af8bd6d 100644
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/DRRouteCLI.java
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/DRRouteCLI.java
@@ -339,8 +339,11 @@
             sb.append("Egress Routing Table\n");

             sb.append(String.format("%s  Node\n", ext("SubID", cw1)));

             for (int i = 0; i < subs.length; i++) {

-                String node = ert.getString(subs[i]);

-                sb.append(String.format("%s  %s\n", ext(subs[i], cw1), node));

+                if(ert!=null&&ert.length()!=0) {

+                    String node = ert.getString(subs[i]);

+                    sb.append(String.format("%s  %s\n", ext(subs[i], cw1), node));

+                }

+

             }

         }

         if (tbl.startsWith("al") || tbl.startsWith("ne")) {