From 75ba003efb7c2b2736aeffb1c96d5fa92e4e529e Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Thu, 20 Jan 2022 17:40:05 +0000 Subject: [PATCH] Updated check on dropItem method. --- .../l2jmobius/gameserver/model/itemcontainer/Inventory.java | 6 ++++++ .../l2jmobius/gameserver/model/itemcontainer/Inventory.java | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java index 8de9286ae5..3ba933f09e 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java @@ -602,6 +602,11 @@ public abstract class Inventory extends ItemContainer */ public Item dropItem(String process, Item item, Player actor, WorldObject reference) { + if (item == null) + { + return null; + } + synchronized (item) { if (!_items.contains(item)) @@ -617,6 +622,7 @@ public abstract class Inventory extends ItemContainer item.updateDatabase(); refreshWeight(); } + return item; } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java index 6c1a97f839..6bbd4a5bff 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java @@ -602,6 +602,11 @@ public abstract class Inventory extends ItemContainer */ public Item dropItem(String process, Item item, Player actor, WorldObject reference) { + if (item == null) + { + return null; + } + synchronized (item) { if (!_items.contains(item)) @@ -617,6 +622,7 @@ public abstract class Inventory extends ItemContainer item.updateDatabase(); refreshWeight(); } + return item; }