From b63be457fd424021708274a34a5758c47a310943 Mon Sep 17 00:00:00 2001 From: Vankka Date: Mon, 28 Mar 2022 12:43:55 +0300 Subject: [PATCH] Null-check executors in JDAConnectionManager#shutdownExecutors --- .../discord/connection/jda/JDAConnectionManager.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/com/discordsrv/common/discord/connection/jda/JDAConnectionManager.java b/common/src/main/java/com/discordsrv/common/discord/connection/jda/JDAConnectionManager.java index 468980db..c75cea31 100644 --- a/common/src/main/java/com/discordsrv/common/discord/connection/jda/JDAConnectionManager.java +++ b/common/src/main/java/com/discordsrv/common/discord/connection/jda/JDAConnectionManager.java @@ -335,8 +335,12 @@ public class JDAConnectionManager implements DiscordConnectionManager { } private void shutdownExecutors() { - gatewayPool.shutdownNow(); - rateLimitPool.shutdownNow(); + if (gatewayPool != null) { + gatewayPool.shutdownNow(); + } + if (rateLimitPool != null) { + rateLimitPool.shutdownNow(); + } } //