diff --git a/src/main/java/me/chayapak1/chomens_bot/commands/GrepLogCommand.java b/src/main/java/me/chayapak1/chomens_bot/commands/GrepLogCommand.java index f8b5e08e..e25d207a 100644 --- a/src/main/java/me/chayapak1/chomens_bot/commands/GrepLogCommand.java +++ b/src/main/java/me/chayapak1/chomens_bot/commands/GrepLogCommand.java @@ -27,7 +27,9 @@ public class GrepLogCommand extends Command { public Component execute(CommandContext context) throws CommandException { final Bot bot = context.bot; - if (bot.discord.jda == null) throw new CommandException(Component.text("The bot's Discord integration has to be enabled to use the command.")); + if (bot.discord == null || bot.discord.jda == null) { + throw new CommandException(Component.text("The bot's Discord integration has to be enabled to use the command.")); + } boolean ignoreCase = false; boolean regex = false;