From bec3fcf1d6a328f831a68e8334a84fbd82f3b0d3 Mon Sep 17 00:00:00 2001 From: Draycia Date: Mon, 13 Dec 2021 20:51:44 -0800 Subject: [PATCH] Alert when returned channel is null --- .../carbon/common/channels/CarbonChannelRegistry.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/net/draycia/carbon/common/channels/CarbonChannelRegistry.java b/common/src/main/java/net/draycia/carbon/common/channels/CarbonChannelRegistry.java index 07e5ce71..4dfe0640 100644 --- a/common/src/main/java/net/draycia/carbon/common/channels/CarbonChannelRegistry.java +++ b/common/src/main/java/net/draycia/carbon/common/channels/CarbonChannelRegistry.java @@ -175,7 +175,12 @@ public class CarbonChannelRegistry implements ChannelRegistry, DefaultedRegistry final @Nullable ChatChannel chatChannel = this.registerChannelFromPath(path); - if (chatChannel != null && chatChannel.shouldRegisterCommands()) { + if (chatChannel == null) { + this.logger.warn("Failed to load channel from file [" + fileName + "]"); + return; + } + + if (chatChannel.shouldRegisterCommands()) { this.registerChannelCommands(chatChannel, commandManager); } });