diff options
| author | Krakenied <Krakenied1@gmail.com> | 2024-09-06 21:09:50 +0200 |
|---|---|---|
| committer | Krakenied <46192742+Krakenied@users.noreply.github.com> | 2024-09-06 21:30:21 +0200 |
| commit | c1a01536f7bd3fdffe46ecd24115c4515350a283 (patch) | |
| tree | 8dc4d105a258c3552026d16c9cc686d010fe094f /bukkit/src | |
| parent | af769229795d3c2ca689b3d80d048b2aabc94ef6 (diff) | |
Add missing null check
Diffstat (limited to 'bukkit/src')
| -rw-r--r-- | bukkit/src/main/java/com/leonardobishop/quests/bukkit/tasktype/type/TradingTaskType.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bukkit/src/main/java/com/leonardobishop/quests/bukkit/tasktype/type/TradingTaskType.java b/bukkit/src/main/java/com/leonardobishop/quests/bukkit/tasktype/type/TradingTaskType.java index 09eeaa59..6fd4440c 100644 --- a/bukkit/src/main/java/com/leonardobishop/quests/bukkit/tasktype/type/TradingTaskType.java +++ b/bukkit/src/main/java/com/leonardobishop/quests/bukkit/tasktype/type/TradingTaskType.java @@ -104,7 +104,7 @@ public final class TradingTaskType extends BukkitTaskType { } } - if (task.hasConfigKey("first-ingredient")) { + if (firstIngredient != null && task.hasConfigKey("first-ingredient")) { QuestItem qi; if ((qi = fixedQuestFirstIngredientCache.get(quest.getId(), task.getId())) == null) { QuestItem fetchedItem = TaskUtils.getConfigQuestItem(task, "first-ingredient", "data"); @@ -112,7 +112,7 @@ public final class TradingTaskType extends BukkitTaskType { qi = fetchedItem; } - super.debug("First ingredient was of type " + (firstIngredient != null ? firstIngredient.getType() : null), quest.getId(), task.getId(), player.getUniqueId()); + super.debug("First ingredient was of type " + firstIngredient.getType(), quest.getId(), task.getId(), player.getUniqueId()); boolean exactMatch = TaskUtils.getConfigBoolean(task, "first-ingredient-exact-match", true); if (!qi.compareItemStack(firstIngredient, exactMatch)) { @@ -121,7 +121,7 @@ public final class TradingTaskType extends BukkitTaskType { } } - if (task.hasConfigKey("second-ingredient")) { + if (secondIngredient != null && task.hasConfigKey("second-ingredient")) { QuestItem qi; if ((qi = fixedQuestSecondIngredientCache.get(quest.getId(), task.getId())) == null) { QuestItem fetchedItem = TaskUtils.getConfigQuestItem(task, "second-ingredient", "data"); @@ -129,7 +129,7 @@ public final class TradingTaskType extends BukkitTaskType { qi = fetchedItem; } - super.debug("Second ingredient was of type " + (secondIngredient != null ? secondIngredient.getType() : null), quest.getId(), task.getId(), player.getUniqueId()); + super.debug("Second ingredient was of type " + secondIngredient.getType(), quest.getId(), task.getId(), player.getUniqueId()); boolean exactMatch = TaskUtils.getConfigBoolean(task, "second-ingredient-exact-match", true); if (!qi.compareItemStack(secondIngredient, exactMatch)) { |
