From 1f7b8a68584e85daa39eed7c9ee3830ad15b73ef Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Sun, 4 Dec 2022 12:51:09 +0700 Subject: [PATCH] Don't throw exception if timer is already finished --- src/main/kotlin/ru/dbotthepony/mc/otm/core/TimerQueue.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/core/TimerQueue.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/core/TimerQueue.kt index 35604a00a..c4747cc94 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/core/TimerQueue.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/core/TimerQueue.kt @@ -44,7 +44,7 @@ class TimerQueue { } fun execute() { - check(!finished) { "Already finished" } + if (finished) return runnable.run() finished = true }