From e6ebbec1867c8b91564fded90edd3d11a7526b6e Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Tue, 8 Oct 2019 09:03:56 +0000 Subject: [PATCH] Fixed NPE in TradeList, also there is no point to log it when it happens. Contributed by Sahar. --- .../java/org/l2jmobius/gameserver/model/TradeList.java | 3 +-- .../java/org/l2jmobius/gameserver/model/TradeList.java | 3 +-- .../java/org/l2jmobius/gameserver/model/TradeList.java | 3 +-- .../java/org/l2jmobius/gameserver/model/TradeList.java | 3 +-- .../java/org/l2jmobius/gameserver/model/TradeList.java | 3 +-- .../java/org/l2jmobius/gameserver/model/TradeList.java | 3 +-- .../java/org/l2jmobius/gameserver/model/TradeList.java | 3 +-- .../java/org/l2jmobius/gameserver/model/TradeList.java | 3 +-- .../java/org/l2jmobius/gameserver/model/TradeList.java | 3 +-- .../java/org/l2jmobius/gameserver/model/TradeList.java | 3 +-- .../java/org/l2jmobius/gameserver/model/TradeList.java | 3 +-- .../java/org/l2jmobius/gameserver/model/TradeList.java | 3 +-- .../java/org/l2jmobius/gameserver/model/TradeList.java | 3 +-- .../java/org/l2jmobius/gameserver/model/TradeList.java | 3 +-- .../java/org/l2jmobius/gameserver/model/TradeList.java | 3 +-- 15 files changed, 15 insertions(+), 30 deletions(-) diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/TradeList.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/TradeList.java index 6ea81e0ccf..9fdf0143c7 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/TradeList.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/TradeList.java @@ -182,9 +182,8 @@ public class TradeList } final WorldObject o = World.getInstance().findObject(objectId); - if (!o.isItem()) + if (!(o instanceof ItemInstance)) { - LOGGER.warning(_owner.getName() + ": Trying to add something other than an item!"); return null; } diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/TradeList.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/TradeList.java index 6ea81e0ccf..9fdf0143c7 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/TradeList.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/TradeList.java @@ -182,9 +182,8 @@ public class TradeList } final WorldObject o = World.getInstance().findObject(objectId); - if (!o.isItem()) + if (!(o instanceof ItemInstance)) { - LOGGER.warning(_owner.getName() + ": Trying to add something other than an item!"); return null; } diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/TradeList.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/TradeList.java index 6ea81e0ccf..9fdf0143c7 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/TradeList.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/TradeList.java @@ -182,9 +182,8 @@ public class TradeList } final WorldObject o = World.getInstance().findObject(objectId); - if (!o.isItem()) + if (!(o instanceof ItemInstance)) { - LOGGER.warning(_owner.getName() + ": Trying to add something other than an item!"); return null; } diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/TradeList.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/TradeList.java index d705f7c116..2833f39777 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/TradeList.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/TradeList.java @@ -184,9 +184,8 @@ public class TradeList } final WorldObject o = World.getInstance().findObject(objectId); - if (!o.isItem()) + if (!(o instanceof ItemInstance)) { - LOGGER.warning(_owner.getName() + ": Trying to add something other than an item!"); return null; } diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/TradeList.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/TradeList.java index b52103adf3..b6fadea412 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/TradeList.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/TradeList.java @@ -184,9 +184,8 @@ public class TradeList } final WorldObject o = World.getInstance().findObject(objectId); - if (!o.isItem()) + if (!(o instanceof ItemInstance)) { - LOGGER.warning(_owner.getName() + ": Trying to add something other than an item!"); return null; } diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/TradeList.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/TradeList.java index b52103adf3..b6fadea412 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/TradeList.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/TradeList.java @@ -184,9 +184,8 @@ public class TradeList } final WorldObject o = World.getInstance().findObject(objectId); - if (!o.isItem()) + if (!(o instanceof ItemInstance)) { - LOGGER.warning(_owner.getName() + ": Trying to add something other than an item!"); return null; } diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/TradeList.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/TradeList.java index b52103adf3..b6fadea412 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/TradeList.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/TradeList.java @@ -184,9 +184,8 @@ public class TradeList } final WorldObject o = World.getInstance().findObject(objectId); - if (!o.isItem()) + if (!(o instanceof ItemInstance)) { - LOGGER.warning(_owner.getName() + ": Trying to add something other than an item!"); return null; } diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/TradeList.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/TradeList.java index b52103adf3..b6fadea412 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/TradeList.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/TradeList.java @@ -184,9 +184,8 @@ public class TradeList } final WorldObject o = World.getInstance().findObject(objectId); - if (!o.isItem()) + if (!(o instanceof ItemInstance)) { - LOGGER.warning(_owner.getName() + ": Trying to add something other than an item!"); return null; } diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/TradeList.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/TradeList.java index 360478dc54..19730950db 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/TradeList.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/TradeList.java @@ -184,9 +184,8 @@ public class TradeList } final WorldObject o = World.getInstance().findObject(objectId); - if (!o.isItem()) + if (!(o instanceof ItemInstance)) { - LOGGER.warning(_owner.getName() + ": Trying to add something other than an item!"); return null; } diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/TradeList.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/TradeList.java index 6ea81e0ccf..9fdf0143c7 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/TradeList.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/TradeList.java @@ -182,9 +182,8 @@ public class TradeList } final WorldObject o = World.getInstance().findObject(objectId); - if (!o.isItem()) + if (!(o instanceof ItemInstance)) { - LOGGER.warning(_owner.getName() + ": Trying to add something other than an item!"); return null; } diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/TradeList.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/TradeList.java index d705f7c116..2833f39777 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/TradeList.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/TradeList.java @@ -184,9 +184,8 @@ public class TradeList } final WorldObject o = World.getInstance().findObject(objectId); - if (!o.isItem()) + if (!(o instanceof ItemInstance)) { - LOGGER.warning(_owner.getName() + ": Trying to add something other than an item!"); return null; } diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/TradeList.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/TradeList.java index b52103adf3..b6fadea412 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/TradeList.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/TradeList.java @@ -184,9 +184,8 @@ public class TradeList } final WorldObject o = World.getInstance().findObject(objectId); - if (!o.isItem()) + if (!(o instanceof ItemInstance)) { - LOGGER.warning(_owner.getName() + ": Trying to add something other than an item!"); return null; } diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/TradeList.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/TradeList.java index b52103adf3..b6fadea412 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/TradeList.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/TradeList.java @@ -184,9 +184,8 @@ public class TradeList } final WorldObject o = World.getInstance().findObject(objectId); - if (!o.isItem()) + if (!(o instanceof ItemInstance)) { - LOGGER.warning(_owner.getName() + ": Trying to add something other than an item!"); return null; } diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/TradeList.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/TradeList.java index b52103adf3..b6fadea412 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/TradeList.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/TradeList.java @@ -184,9 +184,8 @@ public class TradeList } final WorldObject o = World.getInstance().findObject(objectId); - if (!o.isItem()) + if (!(o instanceof ItemInstance)) { - LOGGER.warning(_owner.getName() + ": Trying to add something other than an item!"); return null; } diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/TradeList.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/TradeList.java index b52103adf3..b6fadea412 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/TradeList.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/TradeList.java @@ -184,9 +184,8 @@ public class TradeList } final WorldObject o = World.getInstance().findObject(objectId); - if (!o.isItem()) + if (!(o instanceof ItemInstance)) { - LOGGER.warning(_owner.getName() + ": Trying to add something other than an item!"); return null; }