Alert when returned channel is null

This commit is contained in:
Draycia committed 2021-12-13 20:51:44 -08:00
1 parent 4351547e84
commit bec3fcf1d6
1 file changed
+6 -1
@@ -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);
}
});