Fixed a NPE when an invalid repair material was entered

#1484
This commit is contained in:
TfT_02 2013-09-27 10:46:47 +02:00
parent 36ae84eada
commit 57dfa00541

View File

@ -134,7 +134,7 @@ public class RepairConfig extends ConfigLoader {
}
// Minimum Quantity
int minimumQuantity = (itemMaterial != null ? Repair.getRepairAndSalvageQuantities(new ItemStack(itemMaterial), repairMaterial, repairMetadata) : config.getInt("Repairables." + key + ".MinimumQuantity"));
int minimumQuantity = (itemMaterial != null && repairMaterial != null ? Repair.getRepairAndSalvageQuantities(new ItemStack(itemMaterial), repairMaterial, repairMetadata) : config.getInt("Repairables." + key + ".MinimumQuantity"));
if (minimumQuantity <= 0) {
reason.add("Minimum quantity of " + key + " must be greater than 0!");