java.lang.NullPointerException
at com.dev.phantomEngine.task.AITask.run(AITask.java:29)
at com.l2jmobius.gameserver.ThreadPoolManager$RunnableWrapper.run(ThreadPoolManager.java:89)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
What can be null here?
code:
package com.dev.phantomEngine.task;
import java.util.List;
import com.dev.phantomEngine.PhantomPlayer;
import com.dev.phantomEngine.PhantomPlayerManager;
public class AITask implements Runnable
{
private final int _from;
private int _to;
public AITask(int from, int to)
{
_from = from;
_to = to;
}
@Override
public void run()
{
adjustPotentialIndexOutOfBounds();
List<PhantomPlayer> fakePlayers = PhantomPlayerManager.INSTANCE.getFakePlayers().subList(_from, _to);
try
{
// fakePlayers.stream().filter(x -> !x.getFakeAi().isBusyThinking()).forEach(x -> x.getFakeAi().thinkAndAct());
for (PhantomPlayer p : fakePlayers)
{
if (!p.getFakeAi().isBusyThinking()) <- Here->
{
p.getFakeAi().thinkAndAct(); <- Here->
}
}
}
catch (Exception ex)
{
ex.printStackTrace();
}
}
private void adjustPotentialIndexOutOfBounds()
{
if (_to > PhantomPlayerManager.INSTANCE.getFakePlayersCount())
{
_to = PhantomPlayerManager.INSTANCE.getFakePlayersCount();
}
}
}
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Now that skype is over, we, your custommers.... how we can contact you??
We don't have any other contact method, such as: discord, telegram or anything else...
I mean.. im looking for support from 2 months already..
Question
vRouxy
What can be null here?
code:
print stack trace points to these lines
Edited by vRouxy5 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.