Skip to content

Commit

Permalink
Check if session is closed when running scheduled tasks (#4595)
Browse files Browse the repository at this point in the history
  • Loading branch information
AJ-Ferguson authored Apr 24, 2024
1 parent c342958 commit 16385a4
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1171,7 +1171,9 @@ public void executeInEventLoop(Runnable runnable) {
public ScheduledFuture<?> scheduleInEventLoop(Runnable runnable, long duration, TimeUnit timeUnit) {
return eventLoop.schedule(() -> {
try {
runnable.run();
if (!closed) {
runnable.run();
}
} catch (Throwable e) {
geyser.getLogger().error("Error thrown in " + this.bedrockUsername() + "'s event loop!", e);
}
Expand Down

0 comments on commit 16385a4

Please sign in to comment.