9
0
mirror of https://github.com/HibiscusMC/HMCCosmetics.git synced 2025-12-31 04:46:42 +00:00

placeholder current causing npe

This commit is contained in:
LoJoSho
2023-02-04 18:02:29 -06:00
parent a869120b62
commit 8e5b3d098c

View File

@@ -54,7 +54,9 @@ public class PAPIHook extends PlaceholderExpansion {
}
if (placeholderArgs.get(1) != null) {
Cosmetic cosmetic = Cosmetics.getCosmetic(placeholderArgs.get(1));
if (user.getCosmetic(cosmetic.getSlot()).getId() == cosmetic.getId()) return "true";
Cosmetic currentCosmetic = user.getCosmetic(cosmetic.getSlot());
if (cosmetic == null || currentCosmetic == null) return "false";
if (currentCosmetic.getId() == cosmetic.getId()) return "true";
return "false";
}
case "current":