Преглед на файлове

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

Reported by: d!g0
Nos преди 11 години
родител
ревизия
e89fcfec5b
променени са 1 файла, в които са добавени 8 реда и са изтрити 7 реда
  1. 8 7
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java

+ 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);