Handle an odd null pointer exception within the Bukkit API

This commit is contained in:
Olof Larsson 2017-12-29 18:24:49 +01:00
parent 2bdabf9619
commit 213b8c79d2

View File

@ -1,5 +1,6 @@
package com.massivecraft.massivecore.item; package com.massivecraft.massivecore.item;
import com.massivecraft.massivecore.collections.MassiveList;
import org.bukkit.DyeColor; import org.bukkit.DyeColor;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.block.Banner; import org.bukkit.block.Banner;
@ -54,7 +55,11 @@ public class WriterItemStackMetaShieldPatterns extends WriterAbstractItemStackMe
if (banner == null) return null; if (banner == null) return null;
// Return // Return
return banner.getPatterns(); try {
return banner.getPatterns();
} catch (NullPointerException e) {
return new MassiveList<>();
}
} }
@Override @Override