From 20c65caae7eded1bf14f0e4c42d51e7c369b2ce5 Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Tue, 16 Dec 2014 10:53:29 +0000 Subject: SPIGOT-210: Remove the exception when dropping a non-existant task If the server crashes during chunk generation then the chunk would have never been added to the executor, this caused a second exception to be thrown when the server shutdown from the first exception --- src/main/java/org/bukkit/craftbukkit/util/AsynchronousExecutor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/main/java/org/bukkit/craftbukkit/util/AsynchronousExecutor.java b/src/main/java/org/bukkit/craftbukkit/util/AsynchronousExecutor.java index 81bb0d15..193c3621 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/AsynchronousExecutor.java +++ b/src/main/java/org/bukkit/craftbukkit/util/AsynchronousExecutor.java @@ -263,7 +263,7 @@ public final class AsynchronousExecutor { public boolean drop(P parameter, C callback) throws IllegalStateException { final Task task = tasks.get(parameter); if (task == null) { - throw new IllegalStateException("Unknown " + parameter); + return true; } if (!task.callbacks.remove(callback)) { throw new IllegalStateException("Unknown " + callback + " for " + parameter); -- cgit v1.2.3