Fix possible NPE when 't3-troubleshoot-pingall' command on a host without IP addr
Change-Id: Ibd935d78248e57de55604d3aea1123e08abb9924
(cherry picked from commit 980eea4a63639bf082570c8bf9e882554921112a)
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 5726f56..93e843a 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
@@ -175,7 +175,7 @@
.getCriterion(type)).ip().address();
} else {
ipAddress = host.ipAddresses().stream().filter(IpAddress::isIp4)
- .findAny().orElseGet(null);
+ .findAny().orElse(null);
}
} else {
Criterion.Type type = src ? Criterion.Type.IPV6_SRC : Criterion.Type.IPV6_DST;
@@ -184,7 +184,7 @@
.getCriterion(type)).ip().address();
} else {
ipAddress = host.ipAddresses().stream().filter(IpAddress::isIp6)
- .findAny().orElseGet(null);
+ .findAny().orElse(null);
}
}
return ipAddress;