From e44fbf02185396c6e8c16d7169755fc5b5cbf8bc Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Fri, 15 Sep 2017 14:29:06 +0000 Subject: [PATCH] Fixed possible L2AttackableAI thinkAttack NPE. --- .../java/com/l2jmobius/gameserver/ai/L2AttackableAI.java | 2 +- .../java/com/l2jmobius/gameserver/ai/L2AttackableAI.java | 2 +- .../java/com/l2jmobius/gameserver/ai/L2AttackableAI.java | 2 +- .../java/com/l2jmobius/gameserver/ai/L2AttackableAI.java | 2 +- .../java/com/l2jmobius/gameserver/ai/L2AttackableAI.java | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java index 57c95bd40e..78995bb2b1 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java @@ -575,7 +575,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable { final L2Attackable npc = getActiveChar(); - if (npc.isCastingNow()) + if ((npc == null) || npc.isCastingNow()) { return; } diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java index 57c95bd40e..78995bb2b1 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java @@ -575,7 +575,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable { final L2Attackable npc = getActiveChar(); - if (npc.isCastingNow()) + if ((npc == null) || npc.isCastingNow()) { return; } diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java index 57c95bd40e..78995bb2b1 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java @@ -575,7 +575,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable { final L2Attackable npc = getActiveChar(); - if (npc.isCastingNow()) + if ((npc == null) || npc.isCastingNow()) { return; } diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java index d03b48e301..e121f2b667 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java @@ -695,7 +695,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable protected void thinkAttack() { final L2Attackable npc = getActiveChar(); - if (npc.isCastingNow()) + if ((npc == null) || npc.isCastingNow()) { return; } diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java index 57c95bd40e..78995bb2b1 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java @@ -575,7 +575,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable { final L2Attackable npc = getActiveChar(); - if (npc.isCastingNow()) + if ((npc == null) || npc.isCastingNow()) { return; }