L2JMobius

Public Development => Bug Reports => Topic started by: salamandra on May 20, 2025, 11:31:29 PM

Title: NPE onActionReadyToAct
Post by: salamandra on May 20, 2025, 11:31:29 PM
Server sometimes has an error (NPE)

Code: [Select]
        java.lang.NullPointerException: Cannot read field "_intention" because "this._nextIntention" is null
at org.l2jmobius.gameserver.ai.PlayerAI.onActionReadyToAct(PlayerAI.java:96)
at org.l2jmobius.gameserver.ai.AbstractAI.notifyAction(AbstractAI.java:283)
at org.l2jmobius.gameserver.ai.AbstractAI.notifyAction(AbstractAI.java:211)
at org.l2jmobius.gameserver.model.actor.Creature.onAttackFinish(Creature.java:4321)
at org.l2jmobius.gameserver.taskmanagers.CreatureAttackTaskManager$ScheduleAbortTask.run(CreatureAttackTaskManager.java:127)
at org.l2jmobius.commons.threads.ThreadPool$RunnableWrapper.run(ThreadPool.java:237)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:545)
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:369)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:310)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1095)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:619)
at java.base/java.lang.Thread.run(Thread.java:1447)

Maybe need check on null "_intention" in  AbstractAI

Code: [Select]
        synchronized void changeIntention(Intention intention, Object... args)
{
if (_intention != null)
{
_intention = intention;
_intentionArgs = args;
}
}