How to fix this NullPointerException

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
User avatar
ShinichiYao
Advanced User
Advanced User
Posts: 257
Joined: Tue Jan 12, 2016 3:53 am

How to fix this NullPointerException

Post by ShinichiYao » Fri Jan 26, 2018 4:04 am

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)

User avatar
Sdw
L2j Veteran
L2j Veteran
Posts: 855
Joined: Mon May 03, 2010 8:38 am
Location: France

Re: How to fix this NullPointerException

Post by Sdw » Fri Jan 26, 2018 7:47 pm

return (effector.getActiveWeaponItem().getBodyPart() & _mask) != 0;

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

effector.getActiveWeaponItem()

Is null

User avatar
Sdw
L2j Veteran
L2j Veteran
Posts: 855
Joined: Mon May 03, 2010 8:38 am
Location: France

Re: How to fix this NullPointerException

Post by Sdw » Fri Jan 26, 2018 7:47 pm

return (effector.getActiveWeaponItem().getBodyPart() & _mask) != 0;

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

effector.getActiveWeaponItem()

Is null

User avatar
ShinichiYao
Advanced User
Advanced User
Posts: 257
Joined: Tue Jan 12, 2016 3:53 am

Re: How to fix this NullPointerException

Post by ShinichiYao » Sat Jan 27, 2018 6:17 am

Thanks :+1:

User avatar
ShinichiYao
Advanced User
Advanced User
Posts: 257
Joined: Tue Jan 12, 2016 3:53 am

Re: How to fix this NullPointerException

Post by ShinichiYao » Sat Feb 24, 2018 2:27 pm

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)

Post Reply