Page 1 of 1

How to fix this NullPointerException

Posted: Fri Jan 26, 2018 4:04 am
by ShinichiYao

Code: Select all

Exception in thread "AISTPool-6" java.lang.NullPointerException
        at com.l2jserver.gameserver.model.conditions.ConditionUsingSlotType.testImpl(ConditionUsingSlotType.java:45)
        at com.l2jserver.gameserver.model.conditions.Condition.test(Condition.java:121)
        at com.l2jserver.gameserver.model.conditions.ConditionLogicAnd.testImpl(ConditionLogicAnd.java:80)
        at com.l2jserver.gameserver.model.conditions.Condition.test(Condition.java:121)
        at com.l2jserver.gameserver.model.conditions.Condition.test(Condition.java:111)
        at com.l2jserver.gameserver.model.stats.functions.FuncAdd.calc(FuncAdd.java:40)
        at com.l2jserver.gameserver.model.stats.Calculator.calc(Calculator.java:213)
        at com.l2jserver.gameserver.model.actor.stat.CharStat.calcStat(CharStat.java:100)
        at com.l2jserver.gameserver.model.actor.stat.CharStat.getAccuracy(CharStat.java:137)
        at com.l2jserver.gameserver.model.actor.L2Character.getAccuracy(L2Character.java:6182)
        at com.l2jserver.gameserver.model.stats.Formulas.calcHitMiss(Formulas.java:1239)
        at com.l2jserver.gameserver.model.actor.L2Character.doAttackHitSimple(L2Character.java:1515)
        at com.l2jserver.gameserver.model.actor.L2Character.doAttackHitSimple(L2Character.java:1505)
        at com.l2jserver.gameserver.model.actor.L2Character.doAttack(L2Character.java:1091)
        at com.l2jserver.gameserver.model.actor.instance.L2PcInstance.doAttack(L2PcInstance.java:4773)
        at com.l2jserver.gameserver.ai.L2PlayerAI.thinkAttack(L2PlayerAI.java:250)
        at com.l2jserver.gameserver.ai.L2PlayerAI.onEvtThink(L2PlayerAI.java:345)
        at com.l2jserver.gameserver.ai.L2CharacterAI.onEvtReadyToAct(L2CharacterAI.java:711)
        at com.l2jserver.gameserver.ai.L2PlayerAI.onEvtReadyToAct(L2PlayerAI.java:107)
        at com.l2jserver.gameserver.ai.AbstractAI.notifyEvent(AbstractAI.java:403)
        at com.l2jserver.gameserver.ai.AbstractAI.notifyEvent(AbstractAI.java:342)
        at com.l2jserver.gameserver.model.actor.tasks.character.NotifyAITask.run(NotifyAITask.java:44)
        at com.l2jserver.gameserver.ThreadPoolManager$RunnableWrapper.run(ThreadPoolManager.java:89)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

Re: How to fix this NullPointerException

Posted: Fri Jan 26, 2018 7:47 pm
by Sdw
return (effector.getActiveWeaponItem().getBodyPart() & _mask) != 0;

No check if effector have a weapon, so if he doesn't

effector.getActiveWeaponItem()

Is null

Re: How to fix this NullPointerException

Posted: Fri Jan 26, 2018 7:47 pm
by Sdw
return (effector.getActiveWeaponItem().getBodyPart() & _mask) != 0;

No check if effector have a weapon, so if he doesn't

effector.getActiveWeaponItem()

Is null

Re: How to fix this NullPointerException

Posted: Sat Jan 27, 2018 6:17 am
by ShinichiYao
Thanks :+1:

Re: How to fix this NullPointerException

Posted: Sat Feb 24, 2018 2:27 pm
by ShinichiYao
Some more NPE logs in IceQueensCastleNormalBattle

Code: Select all

WARNING: D:\L2J\game\data\scripts\instances\InstanceLoader.java
java.lang.NullPointerException
	at instances.IceQueensCastleNormalBattle.IceQueensCastleNormalBattle.onAdvEvent(IceQueensCastleNormalBattle.java:197)
	at com.l2jserver.gameserver.model.quest.Quest.notifyEvent(Quest.java:553)
	at com.l2jserver.gameserver.model.quest.QuestTimer$ScheduleTimerTask.run(QuestTimer.java:49)
	at com.l2jserver.gameserver.ThreadPoolManager$RunnableWrapper.run(ThreadPoolManager.java:89)
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

Code: Select all

WARNING: D:\L2J\game\data\scripts\instances\InstanceLoader.java
java.lang.NullPointerException
	at instances.IceQueensCastleNormalBattle.IceQueensCastleNormalBattle.onAdvEvent(IceQueensCastleNormalBattle.java:404)
	at com.l2jserver.gameserver.model.quest.Quest.notifyEvent(Quest.java:553)
	at com.l2jserver.gameserver.model.quest.QuestTimer$ScheduleTimerTask.run(QuestTimer.java:49)
	at com.l2jserver.gameserver.ThreadPoolManager$RunnableWrapper.run(ThreadPoolManager.java:89)
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)