Skip to content

Commit a2c2eeb

Browse files
committed
(fix) error thrown on discord service installed but not configured
1 parent c074227 commit a2c2eeb

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/main/java/cat/nyaa/ukit/show/ShowFunction.java

-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ public boolean invokeCommand(CommandSender commandSender, Command command, Strin
5151
// fail-safe
5252
if (pluginInstance.config.showConfig.enableDiscordRelay) {
5353
EssentialsDiscordRelayUtils.broadCastMessageToChat(pluginInstance.config.showConfig.discordRelayPrefix + LegacyComponentSerializer.legacySection().serialize(message));
54-
5554
}
5655
return true;
5756
}

src/main/java/cat/nyaa/ukit/utils/EssentialsDiscordRelayUtils.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public static boolean isEnabled() {
2323
}
2424

2525
public static void broadCastMessageToChat(String message) {
26-
if (enabled) {
26+
if (enabled && discordService != null) {
2727
discordService.sendMessage(MessageType.DefaultTypes.CHAT, message, false);
2828
}
2929
}

0 commit comments

Comments
 (0)