AreaFriendly target handler NPE fix.

Contributed by antho19.
This commit is contained in:
MobiusDev 2015-11-28 00:45:35 +00:00
parent 6f6d296ecb
commit 664e78f5b3

View File

@ -46,7 +46,7 @@ public class AreaFriendly implements ITargetTypeHandler
List<L2Character> targetList = new ArrayList<>();
L2PcInstance player = activeChar.getActingPlayer();
if (!checkTarget(player, target) && (skill.getCastRange() >= 0))
if ((target == null) || (!checkTarget(player, target) && (skill.getCastRange() >= 0)))
{
player.sendPacket(SystemMessageId.THAT_IS_AN_INCORRECT_TARGET);
return EMPTY_TARGET_LIST;
@ -69,8 +69,6 @@ public class AreaFriendly implements ITargetTypeHandler
}
targetList.add(target); // Add target to target list
if (target != null)
{
int maxTargets = skill.getAffectLimit();
final Collection<L2Character> objs = target.getKnownList().getKnownCharactersInRadius(skill.getAffectRange());
@ -91,7 +89,6 @@ public class AreaFriendly implements ITargetTypeHandler
targetList.add(obj);
}
}
if (targetList.isEmpty())
{