Skip to content

Commit a82af8a

Browse files
Added extra catch for NPE (#119)
1 parent 105692c commit a82af8a

File tree

1 file changed

+3
-0
lines changed
  • library/src/main/java/com/stealthcopter/networktools/ping

1 file changed

+3
-0
lines changed

library/src/main/java/com/stealthcopter/networktools/ping/PingTools.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ public static PingResult doJavaPing(InetAddress ia, PingOptions pingOptions) {
7575
} catch (IOException e) {
7676
pingResult.isReachable = false;
7777
pingResult.error = "IOException: " + e.getMessage();
78+
} catch (NullPointerException e) {
79+
pingResult.isReachable = false;
80+
pingResult.error = "NullPointerException: " + e.getMessage();
7881
}
7982
return pingResult;
8083
}

0 commit comments

Comments
 (0)