3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-12-26 16:12:46 +01:00

Check if session is closed when running scheduled tasks (#4595)

Dieser Commit ist enthalten in:
AJ Ferguson 2024-04-24 01:39:37 -04:00 committet von GitHub
Ursprung c34295829f
Commit 16385a4e2b
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: B5690EEEBB952194

Datei anzeigen

@ -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);
} }