mirror of
https://github.com/HibiscusMC/HMCCosmetics.git
synced 2025-12-29 03:49:19 +00:00
Fixed NPE when not specifying dye
This commit is contained in:
@@ -84,7 +84,9 @@ public class CosmeticsCommand extends CommandBase {
|
||||
|
||||
final ArmorItem armorItem = user.getPlayerArmor().getItem(type);
|
||||
|
||||
this.setDyeColor(dyeColor, armorItem, player);
|
||||
if (dyeColor != null) {
|
||||
this.setDyeColor(dyeColor, armorItem, player);
|
||||
}
|
||||
|
||||
this.userManager.setItem(user, armorItem);
|
||||
|
||||
@@ -138,7 +140,9 @@ public class CosmeticsCommand extends CommandBase {
|
||||
return;
|
||||
}
|
||||
|
||||
this.setDyeColor(dyeColor, armorItem, player);
|
||||
if (dyeColor != null) {
|
||||
this.setDyeColor(dyeColor, armorItem, player);
|
||||
}
|
||||
|
||||
final Message setMessage = Messages.getSetMessage(armorItem.getType());
|
||||
final Message setOtherMessage = Messages.getSetOtherMessage(armorItem.getType());
|
||||
|
||||
Reference in New Issue
Block a user