From 63fbe27754ea51ec782bb08968bff0ba2b94ab3e Mon Sep 17 00:00:00 2001 From: Liam Date: Thu, 27 Jun 2024 21:34:31 +0100 Subject: [PATCH] check if the guild is valid before getting it --- src/main/java/cc/fascinated/bat/service/GuildService.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/cc/fascinated/bat/service/GuildService.java b/src/main/java/cc/fascinated/bat/service/GuildService.java index 1b322a6..2a41387 100644 --- a/src/main/java/cc/fascinated/bat/service/GuildService.java +++ b/src/main/java/cc/fascinated/bat/service/GuildService.java @@ -59,6 +59,9 @@ public class GuildService extends ListenerAdapter { if (guilds.containsKey(id)) { return guilds.get(id); } + if (DiscordService.JDA.getGuildById(id) == null) { + return null; + } long start = System.currentTimeMillis(); Optional optionalGuild = guildRepository.findById(id);