Bläddra i källkod

BETA: Fixed possible NPE in `L2PcInstance#onTeleported`.

Reported by: d!g0
Nos 11 år sedan
förälder
incheckning
e89fcfec5b

+ 8 - 7
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java

@@ -11024,13 +11024,14 @@ public final class L2PcInstance extends L2Playable
 		}
 		
 		// Modify the position of the pet if necessary
-		if (hasSummon())
-		{
-			getSummon().setFollowStatus(false);
-			getSummon().teleToLocation(getLocation(), false);
-			((L2SummonAI) getSummon().getAI()).setStartFollowController(true);
-			getSummon().setFollowStatus(true);
-			getSummon().updateAndBroadcastStatus(0);
+		final L2Summon summon = getSummon();
+		if (summon != null)
+		{
+			summon.setFollowStatus(false);
+			summon.teleToLocation(getLocation(), false);
+			((L2SummonAI) summon.getAI()).setStartFollowController(true);
+			summon.setFollowStatus(true);
+			summon.updateAndBroadcastStatus(0);
 		}
 		
 		TvTEvent.onTeleported(this);