Skip to content

Commit

Permalink
fix: safety catch for moa skin NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
bconlon1 committed Nov 12, 2024
1 parent 0893691 commit 6df30dd
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,12 @@ public Map<UUID, T> getServerPerkData(MinecraftServer server) {
for (Map.Entry<UUID, T> serverPerkDataEntry : this.getSavedMap(server).entrySet()) { // Iterates through perk data that is stored by the server world.
if (storedUsers.containsKey(serverPerkDataEntry.getKey())) { // Ensures the UUID from the perk data map also exists in the user map.
User user = storedUsers.get(serverPerkDataEntry.getKey()); // Gets the User corresponding to the UUID.
if (user != null && this.getVerificationPredicate(serverPerkDataEntry.getValue()).test(user)) { // Double checks whether the User has access to the perk that is currently attached to its UUID.
verifiedPerkData.put(serverPerkDataEntry.getKey(), serverPerkDataEntry.getValue()); // Adds the UUID and perk to the map indicating that the entry pair is verified.
try {
if (user != null && this.getVerificationPredicate(serverPerkDataEntry.getValue()).test(user)) { // Double checks whether the User has access to the perk that is currently attached to its UUID.
verifiedPerkData.put(serverPerkDataEntry.getKey(), serverPerkDataEntry.getValue()); // Adds the UUID and perk to the map indicating that the entry pair is verified.
}
} catch (RuntimeException e) {
Aether.LOGGER.info(e.getMessage());
}
}
}
Expand Down

0 comments on commit 6df30dd

Please sign in to comment.