tomkeuper / BedWars2023

A minecraft minigame where you have to defend your bed and destroy the others. Once your bed is destroyed, you cannot respawn.
GNU General Public License v3.0
55 stars 16 forks source link

NPE on announcement when arena is empty #142

Closed tomkeuper closed 1 year ago

tomkeuper commented 1 year ago

Describe the bug Announcements dont get cleaned up after an arena is finished

To Reproduce Steps to reproduce the behavior:

Log [23:29:37 WARN]: [BedWars2023] Plugin BedWars2023 v1.0-SNAPSHOT generated an exception while executing task 4967 java.lang.NullPointerException: Cannot invoke "java.util.List.iterator()" because the return value of "com.tomkeuper.bedwars.arena.Arena.getPlayers()" is null at com.tomkeuper.bedwars.arena.Announcement$1.run(Announcement.java:53) ~[bedwars-plugin-1.0-SNAPSHOT.jar:?] at org.bukkit.craftbukkit.v1_19_R3.scheduler.CraftTask.run(CraftTask.java:101) ~[purpur-1.19.4.jar:git-Purpur-1962] at org.bukkit.craftbukkit.v1_19_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) ~[purpur-1.19.4.jar:git-Purpur-1962] at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[purpur-1.19.4.jar:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?] at java.lang.Thread.run(Thread.java:833) ~[?:?]

Expected Behaviour Clean up announcements after an arena is finished.

System (please complete the following information):

tomkeuper commented 1 year ago

fixed with 89d419ddae5644f50186f55a0b00924245041f45