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.
sell adena
l2rebon signature x1 - 1kk = 1 dollars
l2reborn x10 - 500kk = 4 dollars
E-Global x Lu4 - 1kk = 2 dollars
BOHPTS - x20-x500 TOP PRICE
LINEAGE2DEX - TOP PRICE !!!!!
DISCORD - GODDARDSHOP
TELEGRAM - MMOPROMO
Also on sale are Epic jewelry, Clothes at a very good price
🎉 Ανοίγουμε επίσημα το GameNest – το απόλυτο Gaming Marketplace στην Ελλάδα!
Εδώ θα βρεις:
🎮 Αγοραπωλησίες & ανταλλαγές in-game items, accounts και tech προϊόντων
📢 Δυνατότητα διαφήμισης για όσους έχουν servers, projects ή streams
🤝 Ασφαλές περιβάλλον με verified sellers & reviews
🎁 Συνεχόμενα Giveaways για όλους!
Η συμμετοχή είναι δωρεάν για όλα τα μέλη 👌
Υπάρχει και VIP συνδρομή για όσους θέλουν exclusive προνόμια, αλλά δεν είναι υποχρεωτική.
🚀 Μπες κι εσύ στο GameNest από την πρώτη μέρα και γίνε κομμάτι της πιο δυνατής gaming κοινότητας!
💣Today we’re officially launching GameNest – the ultimate Gaming Marketplace in Greece!
Here you’ll get:
🎮 Buy, sell & trade in-game items, accounts, and tech products
📢 Advertising opportunities for servers, projects, and streamers
🤝 A safe environment with verified sellers & reviews
🎁 Tons of ongoing Giveaways for everyone!
Joining is 100% free 👌
There’s also a VIP subscription with extra perks, but it’s completely optional.
🚀 Don’t miss Day 1 of GameNest and become part of the strongest gaming community around!
✴️JOIN NOW
https://discord.gg/77bY4fVGM
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.