Fixed probable NPE when admin uses not owned items.
Contributed by nasseka.
This commit is contained in:
		| @@ -100,7 +100,7 @@ public class RequestDestroyItem implements IClientIncomingPacket | ||||
| 			if (player.isGM()) | ||||
| 			{ | ||||
| 				final WorldObject obj = World.getInstance().findObject(_objectId); | ||||
| 				if (obj.isItem()) | ||||
| 				if ((obj != null) && obj.isItem()) | ||||
| 				{ | ||||
| 					if (_count > ((Item) obj).getCount()) | ||||
| 					{ | ||||
|   | ||||
| @@ -104,7 +104,7 @@ public class UseItem implements IClientIncomingPacket | ||||
| 			if (player.isGM()) | ||||
| 			{ | ||||
| 				final WorldObject obj = World.getInstance().findObject(_objectId); | ||||
| 				if (obj.isItem()) | ||||
| 				if ((obj != null) && obj.isItem()) | ||||
| 				{ | ||||
| 					AdminCommandHandler.getInstance().useAdminCommand(player, "admin_use_item " + _objectId, true); | ||||
| 				} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 MobiusDevelopment
					MobiusDevelopment