Added null check before getting effect type name

This commit is contained in:
Zeshan Aslam 2021-06-08 19:03:51 -04:00
parent 6c0a799198
commit b8d5146d2f
1 changed files with 4 additions and 2 deletions

View File

@ -76,8 +76,10 @@ public class ActionHelper {
PotionMeta potionMeta = (PotionMeta) itemStack.getItemMeta();
PotionData potionData = potionMeta.getBasePotionData();
possibleMaterials.add(potionData.getType().getEffectType().getName() + "_" + name);
if (potionData.getType().getEffectType() != null) {
possibleMaterials.add(potionData.getType().getEffectType().getName() + "_" + name);
}
if (potionMeta.hasCustomEffects()) {
for (PotionEffect potionEffect : potionMeta.getCustomEffects()) {
possibleMaterials.add(potionEffect.getType().getName() + "_" + name);