mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-09-27 14:13:05 +02:00
Fix possible NPE when loading material sets from config
This commit is contained in:
parent
129663650f
commit
13b727c779
@ -43,9 +43,10 @@ public class Properties {
|
|||||||
if (o instanceof Material) {
|
if (o instanceof Material) {
|
||||||
set.add((Material) o);
|
set.add((Material) o);
|
||||||
} else if (o instanceof String) {
|
} else if (o instanceof String) {
|
||||||
try {
|
Material m = Material.getMaterial(((String) o).toUpperCase(Locale.ROOT));
|
||||||
set.add(Material.getMaterial(((String) o).toUpperCase(Locale.ROOT)));
|
if (m != null) {
|
||||||
} catch (IllegalArgumentException e) {
|
set.add(m);
|
||||||
|
} else {
|
||||||
ChestShop.getBukkitLogger().log(Level.WARNING, o + " is not a valid Material name in the config!");
|
ChestShop.getBukkitLogger().log(Level.WARNING, o + " is not a valid Material name in the config!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user