Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot invoke "java.util.Map.put(Object, Object)" because the return value of "java.util.Map.get(Object)" is null #39

Open
heytek opened this issue Aug 31, 2022 · 1 comment

Comments

@heytek
Copy link

heytek commented Aug 31, 2022

java.lang.NullPointerException: Cannot invoke "java.util.Map.put(Object, Object)" because the return value of "java.util.Map.get(Object)" is null
at fr.minuskube.netherboard.bukkit.BPlayerBoard.sendScore(BPlayerBoard.java:212) ~[?:?]
at fr.minuskube.netherboard.bukkit.BPlayerBoard.set(BPlayerBoard.java:104) ~[?:?]
at fr.minuskube.netherboard.bukkit.BPlayerBoard.setAll(BPlayerBoard.java:128) ~[?:?]
at me.heytek.utils.ScoreboardUtil.updateStats(ScoreboardUtil.java:98) ~[?:?]
at me.heytek.listeners.DeathListener$1.run(DeathListener.java:42) ~[?:?]
at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftTask.run(CraftTask.java:100) ~[patched_1.16.5.jar:git-Patina-ver/1.16.5-"667fb1b"]
at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:58) ~[patched_1.16.5.jar:git-Patina-ver/1.16.5-"667fb1b"]
at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[patched_1.16.5.jar:git-Patina-ver/1.16.5-"667fb1b"]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) [?:?]
at java.lang.Thread.run(Thread.java:831) [?:?]

@MinusKube
Copy link
Owner

(Sorry for the late answer)

It seems like you're updating the scoreboard within an async task, Netherboard is not thread-safe, so you'll have to update the scoreboard within the main thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants