Fixed potential NPE.
This commit is contained in:
parent
ae314108a3
commit
a7cace0fdc
|
@ -643,11 +643,15 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
|
||||||
if (feeSection.isInt("currency")) {
|
if (feeSection.isInt("currency")) {
|
||||||
int oldCurrencyItemId = feeSection.getInt("currency", -1);
|
int oldCurrencyItemId = feeSection.getInt("currency", -1);
|
||||||
if (oldCurrencyItemId >= 0) {
|
if (oldCurrencyItemId >= 0) {
|
||||||
String flatteningType = IdMappings.getById(Integer.toString(oldCurrencyItemId))
|
IdMappings.Mapping mapping = IdMappings.getById(Integer.toString(oldCurrencyItemId));
|
||||||
.getFlatteningType();
|
if (mapping != null) {
|
||||||
world.setCurrency(Material.matchMaterial(flatteningType));
|
world.setCurrency(Material.matchMaterial(mapping.getFlatteningType()));
|
||||||
|
} else {
|
||||||
|
world.setCurrency(null);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
world.setCurrency(null);
|
||||||
}
|
}
|
||||||
world.setCurrency(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (feeSection.isDouble("amount"))
|
if (feeSection.isDouble("amount"))
|
||||||
|
|
Loading…
Reference in New Issue