mirror of
https://github.com/Minestom/Minestom.git
synced 2024-09-29 15:07:36 +02: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) {
|
synchronized void cancelTask(TaskImpl task) {
|
||||||
if (!registeredTasks.checkedRemove(task.id()))
|
this.registeredTasks.remove(task.id());
|
||||||
throw new IllegalStateException("Task is not scheduled");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
synchronized boolean isTaskAlive(TaskImpl task) {
|
synchronized boolean isTaskAlive(TaskImpl task) {
|
||||||
|
Loading…
Reference in New Issue
Block a user