mirror of https://github.com/GeyserMC/Geyser.git
Check if session is closed when running scheduled tasks (#4595)
This commit is contained in:
parent
c34295829f
commit
16385a4e2b
|
@ -1171,7 +1171,9 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
|
||||||
public ScheduledFuture<?> scheduleInEventLoop(Runnable runnable, long duration, TimeUnit timeUnit) {
|
public ScheduledFuture<?> scheduleInEventLoop(Runnable runnable, long duration, TimeUnit timeUnit) {
|
||||||
return eventLoop.schedule(() -> {
|
return eventLoop.schedule(() -> {
|
||||||
try {
|
try {
|
||||||
runnable.run();
|
if (!closed) {
|
||||||
|
runnable.run();
|
||||||
|
}
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
geyser.getLogger().error("Error thrown in " + this.bedrockUsername() + "'s event loop!", e);
|
geyser.getLogger().error("Error thrown in " + this.bedrockUsername() + "'s event loop!", e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue