Fix npe when host does not have valid ipv6 address

Change-Id: I411ec372eb16a1a2b5071a79b81af173de25bdbd
diff --git a/apps/t3/app/src/main/java/org/onosproject/t3/cli/TroubleshootPingAllCommand.java b/apps/t3/app/src/main/java/org/onosproject/t3/cli/TroubleshootPingAllCommand.java
index f9d7376..204d863 100644
--- a/apps/t3/app/src/main/java/org/onosproject/t3/cli/TroubleshootPingAllCommand.java
+++ b/apps/t3/app/src/main/java/org/onosproject/t3/cli/TroubleshootPingAllCommand.java
@@ -165,7 +165,7 @@
         IpAddress ipAddress;
         if (ipv4) {
             Criterion.Type type = src ? Criterion.Type.IPV4_SRC : Criterion.Type.IPV4_DST;
-            if (trace.getInitialPacket().getCriterion(type) != null) {
+            if (trace.getInitialPacket() != null && trace.getInitialPacket().getCriterion(type) != null) {
                 ipAddress = ((IPCriterion) trace.getInitialPacket()
                         .getCriterion(type)).ip().address();
             } else {
@@ -174,7 +174,7 @@
             }
         } else {
             Criterion.Type type = src ? Criterion.Type.IPV6_SRC : Criterion.Type.IPV6_DST;
-            if (trace.getInitialPacket().getCriterion(type) != null) {
+            if (trace.getInitialPacket() != null && trace.getInitialPacket().getCriterion(type) != null) {
                 ipAddress = ((IPCriterion) trace.getInitialPacket()
                         .getCriterion(type)).ip().address();
             } else {