From 57194421444e021e6461be17ab5c41cb18b77aea Mon Sep 17 00:00:00 2001 From: ASangarin Date: Fri, 24 Jul 2020 18:50:18 +0200 Subject: [PATCH] Added a check when using an upgradeable to check if the template exists. --- .../java/net/Indyuce/mmoitems/stat/data/UpgradeData.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/net/Indyuce/mmoitems/stat/data/UpgradeData.java b/src/main/java/net/Indyuce/mmoitems/stat/data/UpgradeData.java index e46f3b4f..5771058a 100644 --- a/src/main/java/net/Indyuce/mmoitems/stat/data/UpgradeData.java +++ b/src/main/java/net/Indyuce/mmoitems/stat/data/UpgradeData.java @@ -72,6 +72,11 @@ public class UpgradeData implements StatData, RandomStatData { } public void upgrade(MMOItem mmoitem) { + if(!MMOItems.plugin.getUpgrades().hasTemplate(template)) { + MMOItems.plugin.getLogger().warning("Couldn't find upgrade template '" + template + "'. Does it exist?"); + return; + } + // change display name String suffix = new ColorParse('&', MMOItems.plugin.getConfig().getString("item-upgrading.name-suffix")).toChatColor(); if (MMOItems.plugin.getConfig().getBoolean("item-upgrading.display-in-name"))