mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-12-24 17:17:49 +01:00
Added prevention against NPEs in MaterialUtil
This commit is contained in:
parent
cee04e8940
commit
817fdeae3f
@ -383,7 +383,9 @@ public class MaterialUtil {
|
||||
if (data instanceof TexturedMaterial) {
|
||||
return ((TexturedMaterial) data).getMaterial().name();
|
||||
} else if (data instanceof Colorable) {
|
||||
return ((Colorable) data).getColor().name();
|
||||
DyeColor color = ((Colorable) data).getColor();
|
||||
|
||||
return (color != null ? color.name() : null);
|
||||
} else if (data instanceof Tree) {
|
||||
//TreeSpecies specie = TreeSpecies.getByData((byte) (data.getData() & 3)); //This works, but not as intended
|
||||
TreeSpecies specie = ((Tree) data).getSpecies();
|
||||
|
Loading…
Reference in New Issue
Block a user