From 74f3eab7e670796ffab2586f478e0235d640b253 Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Fri, 15 Sep 2017 14:40:37 +0000 Subject: [PATCH] Fixed possible RequestAcquireSkillInfo NPE. --- .../network/clientpackets/RequestAcquireSkillInfo.java | 4 ++-- .../network/clientpackets/RequestAcquireSkillInfo.java | 4 ++-- .../network/clientpackets/RequestAcquireSkillInfo.java | 4 ++-- .../network/clientpackets/RequestAcquireSkillInfo.java | 4 ++-- .../network/clientpackets/RequestAcquireSkillInfo.java | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkillInfo.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkillInfo.java index 642b423b4b..fd2314b334 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkillInfo.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkillInfo.java @@ -67,7 +67,7 @@ public final class RequestAcquireSkillInfo implements IClientIncomingPacket } final L2Npc trainer = activeChar.getLastFolkNPC(); - if (!(trainer instanceof L2NpcInstance) && (_skillType != AcquireSkillType.CLASS)) + if ((trainer == null) || (!(trainer instanceof L2NpcInstance) && (_skillType != AcquireSkillType.CLASS))) { return; } @@ -90,7 +90,7 @@ public final class RequestAcquireSkillInfo implements IClientIncomingPacket { if (prevSkillLevel == _level) { - _log.warning(RequestAcquireSkillInfo.class.getSimpleName() + ": Player " + activeChar.getName() + " is trequesting info for a skill that already knows, Id: " + _id + " level: " + _level + "!"); + _log.warning(RequestAcquireSkillInfo.class.getSimpleName() + ": Player " + activeChar.getName() + " is requesting info for a skill that already knows, Id: " + _id + " level: " + _level + "!"); } else if (prevSkillLevel != (_level - 1)) { diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkillInfo.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkillInfo.java index 642b423b4b..fd2314b334 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkillInfo.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkillInfo.java @@ -67,7 +67,7 @@ public final class RequestAcquireSkillInfo implements IClientIncomingPacket } final L2Npc trainer = activeChar.getLastFolkNPC(); - if (!(trainer instanceof L2NpcInstance) && (_skillType != AcquireSkillType.CLASS)) + if ((trainer == null) || (!(trainer instanceof L2NpcInstance) && (_skillType != AcquireSkillType.CLASS))) { return; } @@ -90,7 +90,7 @@ public final class RequestAcquireSkillInfo implements IClientIncomingPacket { if (prevSkillLevel == _level) { - _log.warning(RequestAcquireSkillInfo.class.getSimpleName() + ": Player " + activeChar.getName() + " is trequesting info for a skill that already knows, Id: " + _id + " level: " + _level + "!"); + _log.warning(RequestAcquireSkillInfo.class.getSimpleName() + ": Player " + activeChar.getName() + " is requesting info for a skill that already knows, Id: " + _id + " level: " + _level + "!"); } else if (prevSkillLevel != (_level - 1)) { diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkillInfo.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkillInfo.java index 642b423b4b..fd2314b334 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkillInfo.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkillInfo.java @@ -67,7 +67,7 @@ public final class RequestAcquireSkillInfo implements IClientIncomingPacket } final L2Npc trainer = activeChar.getLastFolkNPC(); - if (!(trainer instanceof L2NpcInstance) && (_skillType != AcquireSkillType.CLASS)) + if ((trainer == null) || (!(trainer instanceof L2NpcInstance) && (_skillType != AcquireSkillType.CLASS))) { return; } @@ -90,7 +90,7 @@ public final class RequestAcquireSkillInfo implements IClientIncomingPacket { if (prevSkillLevel == _level) { - _log.warning(RequestAcquireSkillInfo.class.getSimpleName() + ": Player " + activeChar.getName() + " is trequesting info for a skill that already knows, Id: " + _id + " level: " + _level + "!"); + _log.warning(RequestAcquireSkillInfo.class.getSimpleName() + ": Player " + activeChar.getName() + " is requesting info for a skill that already knows, Id: " + _id + " level: " + _level + "!"); } else if (prevSkillLevel != (_level - 1)) { diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkillInfo.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkillInfo.java index c6bf4c48f3..81a6b72ca2 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkillInfo.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkillInfo.java @@ -63,7 +63,7 @@ public final class RequestAcquireSkillInfo extends L2GameClientPacket } final L2Npc trainer = activeChar.getLastFolkNPC(); - if (!(trainer instanceof L2NpcInstance)) + if ((trainer == null) || !(trainer instanceof L2NpcInstance)) { return; } @@ -86,7 +86,7 @@ public final class RequestAcquireSkillInfo extends L2GameClientPacket { if (prevSkillLevel == _level) { - _log.warning(RequestAcquireSkillInfo.class.getSimpleName() + ": Player " + activeChar.getName() + " is trequesting info for a skill that already knows, Id: " + _id + " level: " + _level + "!"); + _log.warning(RequestAcquireSkillInfo.class.getSimpleName() + ": Player " + activeChar.getName() + " is requesting info for a skill that already knows, Id: " + _id + " level: " + _level + "!"); } else if (prevSkillLevel != (_level - 1)) { diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkillInfo.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkillInfo.java index 642b423b4b..fd2314b334 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkillInfo.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkillInfo.java @@ -67,7 +67,7 @@ public final class RequestAcquireSkillInfo implements IClientIncomingPacket } final L2Npc trainer = activeChar.getLastFolkNPC(); - if (!(trainer instanceof L2NpcInstance) && (_skillType != AcquireSkillType.CLASS)) + if ((trainer == null) || (!(trainer instanceof L2NpcInstance) && (_skillType != AcquireSkillType.CLASS))) { return; } @@ -90,7 +90,7 @@ public final class RequestAcquireSkillInfo implements IClientIncomingPacket { if (prevSkillLevel == _level) { - _log.warning(RequestAcquireSkillInfo.class.getSimpleName() + ": Player " + activeChar.getName() + " is trequesting info for a skill that already knows, Id: " + _id + " level: " + _level + "!"); + _log.warning(RequestAcquireSkillInfo.class.getSimpleName() + ": Player " + activeChar.getName() + " is requesting info for a skill that already knows, Id: " + _id + " level: " + _level + "!"); } else if (prevSkillLevel != (_level - 1)) {