Browse Source

BETA: Fixing 2 rare NPEs.

Rumen Nikiforov 12 năm trước cách đây
mục cha
commit
3ac56eaf77

+ 1 - 2
L2J_Server_BETA/java/com/l2jserver/gameserver/ai/L2AttackableAI.java

@@ -1268,7 +1268,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
 			{
 				targetReconsider();
 			}
-			else
+			else if (getAttackTarget() != null)
 			{
 				if (getAttackTarget().isMoving())
 				{
@@ -1279,7 +1279,6 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
 					range = 5;
 				}
 				moveToPawn(getAttackTarget(), range);
-				
 			}
 			return;
 		}

+ 5 - 2
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java

@@ -4974,8 +4974,11 @@ public final class L2PcInstance extends L2Playable
 	
 	public void queryGameGuard()
 	{
-		getClient().setGameGuardOk(false);
-		sendPacket(GameGuardQuery.STATIC_PACKET);
+		if (getClient() != null)
+		{
+			getClient().setGameGuardOk(false);
+			sendPacket(GameGuardQuery.STATIC_PACKET);
+		}
 		if (Config.GAMEGUARD_ENFORCE)
 		{
 			ThreadPoolManager.getInstance().scheduleGeneral(new GameGuardCheck(), 30 * 1000);