From e7832e1406a08282fa35dcc1070bb0c56047918b Mon Sep 17 00:00:00 2001 From: Rogiel Date: Fri, 16 Dec 2011 13:40:38 -0200 Subject: [PATCH] Fixes an NullPointerException in CharacterService.receiveValidation --- .../game/character/CharacterServiceImpl.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/l2jserver2-gameserver/src/main/java/com/l2jserver/service/game/character/CharacterServiceImpl.java b/l2jserver2-gameserver/src/main/java/com/l2jserver/service/game/character/CharacterServiceImpl.java index 8bf9740e1..2544be29d 100644 --- a/l2jserver2-gameserver/src/main/java/com/l2jserver/service/game/character/CharacterServiceImpl.java +++ b/l2jserver2-gameserver/src/main/java/com/l2jserver/service/game/character/CharacterServiceImpl.java @@ -503,11 +503,15 @@ public class CharacterServiceImpl extends AbstractService implements // BroadcastService will catch this event and update the knownlist eventDispatcher.dispatch(new CharacterMoveEvent(character, old)); - if (point.getCoordinate().equals( - character.getTargetLocation().getCoordinate())) { - character.setState(null); - character.setTargetLocation(null); - // TODO dispatch stop event + // target location is null if picking an item right after logging in and + // has not moved the char. + if (character.getTargetLocation() != null) { + if (point.getCoordinate().equals( + character.getTargetLocation().getCoordinate())) { + character.setState(null); + character.setTargetLocation(null); + // TODO dispatch stop event + } } }