mirror of
https://github.com/PaperMC/Folia.git
synced 2025-02-16 01:22:04 +01:00
Fix NPE in treeFinished()
tryPushTasks returns null when there are no tasks, not an empty list.
This commit is contained in:
parent
04b28a65ca
commit
8ffa40246a
@ -341,7 +341,7 @@ index 73ce0909bd89244835a0d0f2030a25871461f1e0..ecc366a4176b2efadc46aa91aa21621f
|
|||||||
@Override
|
@Override
|
||||||
diff --git a/src/main/java/io/papermc/paper/chunk/system/scheduling/queue/RadiusAwarePrioritisedExecutor.java b/src/main/java/io/papermc/paper/chunk/system/scheduling/queue/RadiusAwarePrioritisedExecutor.java
|
diff --git a/src/main/java/io/papermc/paper/chunk/system/scheduling/queue/RadiusAwarePrioritisedExecutor.java b/src/main/java/io/papermc/paper/chunk/system/scheduling/queue/RadiusAwarePrioritisedExecutor.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..f3ec7a7fcfee31b618104499449643baea602478
|
index 0000000000000000000000000000000000000000..6648f8cc5c1788ec02a3adbb68cf126372017dd3
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/io/papermc/paper/chunk/system/scheduling/queue/RadiusAwarePrioritisedExecutor.java
|
+++ b/src/main/java/io/papermc/paper/chunk/system/scheduling/queue/RadiusAwarePrioritisedExecutor.java
|
||||||
@@ -0,0 +1,664 @@
|
@@ -0,0 +1,664 @@
|
||||||
@ -384,7 +384,7 @@ index 0000000000000000000000000000000000000000..f3ec7a7fcfee31b618104499449643ba
|
|||||||
+ if (queue.hasWaitingTasks()) {
|
+ if (queue.hasWaitingTasks()) {
|
||||||
+ final List<PrioritisedExecutor.PrioritisedTask> ret = queue.tryPushTasks();
|
+ final List<PrioritisedExecutor.PrioritisedTask> ret = queue.tryPushTasks();
|
||||||
+
|
+
|
||||||
+ if (ret.isEmpty()) {
|
+ if (ret == null || ret.isEmpty()) {
|
||||||
+ // this happens when the tasks in the wait queue were purged
|
+ // this happens when the tasks in the wait queue were purged
|
||||||
+ // in this case, the queue was actually empty, we just had to purge it
|
+ // in this case, the queue was actually empty, we just had to purge it
|
||||||
+ // if we set the selected queue without scheduling any tasks, the queue will never be unselected
|
+ // if we set the selected queue without scheduling any tasks, the queue will never be unselected
|
||||||
|
Loading…
Reference in New Issue
Block a user