mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-29 19:41:47 +01:00
Do not throw an exception if the task is not registered
Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
parent
9af41f944a
commit
f0104f7f1d
@ -82,8 +82,7 @@ final class SchedulerImpl implements Scheduler {
|
||||
}
|
||||
|
||||
synchronized void cancelTask(TaskImpl task) {
|
||||
if (!registeredTasks.checkedRemove(task.id()))
|
||||
throw new IllegalStateException("Task is not scheduled");
|
||||
this.registeredTasks.remove(task.id());
|
||||
}
|
||||
|
||||
synchronized boolean isTaskAlive(TaskImpl task) {
|
||||
|
Loading…
Reference in New Issue
Block a user