Skip to content

Commit

Permalink
Switch order of literals to prevent NullPointerException
Browse files Browse the repository at this point in the history
  • Loading branch information
pixeebot[bot] authored Dec 15, 2024
1 parent 6425930 commit e7ea6f2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public static boolean isURLReachable(String urlStr) {

// Allow only http and https protocols
String protocol = url.getProtocol();
if (!protocol.equals("http") && !protocol.equals("https")) {
if (!"http".equals(protocol) && !"https".equals(protocol)) {
return false; // Disallow other protocols
}

Expand Down

0 comments on commit e7ea6f2

Please sign in to comment.