Fixed NPE in TradeList, also there is no point to log it when it happens.

Contributed by Sahar.
This commit is contained in:
MobiusDevelopment
2019-10-08 09:03:56 +00:00
parent 99fc3fb8bb
commit e6ebbec186
15 changed files with 15 additions and 30 deletions

View File

@ -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;
}