Skip to content

Commit

Permalink
handle null uuids cleaner
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Sep 30, 2022
1 parent df5362e commit 5b689a3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/org/mcmonkey/sentinel/SentinelUtilities.java
Expand Up @@ -605,6 +605,9 @@ public static void broadcastToSelected(NPC npc, String message) {
* Equivalent to "UUID#equals(...)" but ignoring the UUID version flag, to make NPC UUIDs (v4) and entity UUIDS (v2) of the same value be considered equivalent.
*/
public static boolean uuidEquals(UUID a, UUID b) {
if (a == null || b == null) {
return a == null && b == null;
}
if (a.getLeastSignificantBits() != b.getLeastSignificantBits()) {
return false;
}
Expand Down

0 comments on commit 5b689a3

Please sign in to comment.