From 5d9e5c110be628bf8c0f4b1d3a9cf37cfa069cc8 Mon Sep 17 00:00:00 2001 From: rtm516 Date: Sun, 15 Dec 2024 15:13:34 +0000 Subject: [PATCH] Add config check to extension --- .../bootstrap/geyser/MCXboxBroadcastExtension.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bootstrap/geyser/src/main/java/com/rtm516/mcxboxbroadcast/bootstrap/geyser/MCXboxBroadcastExtension.java b/bootstrap/geyser/src/main/java/com/rtm516/mcxboxbroadcast/bootstrap/geyser/MCXboxBroadcastExtension.java index 78de721..1365fa0 100644 --- a/bootstrap/geyser/src/main/java/com/rtm516/mcxboxbroadcast/bootstrap/geyser/MCXboxBroadcastExtension.java +++ b/bootstrap/geyser/src/main/java/com/rtm516/mcxboxbroadcast/bootstrap/geyser/MCXboxBroadcastExtension.java @@ -132,6 +132,13 @@ public void onPostInitialize(GeyserPostInitializeEvent event) { // Load the config file config = ConfigLoader.load(this, MCXboxBroadcastExtension.class, ExtensionConfig.class); + // Make sure we loaded a config and disable the extension if we didn't + if (config == null) { + logger.error("Failed to load config, extension will not start!"); + this.disable(); + return; + } + // TODO Support multiple notification types notificationManager = new SlackNotificationManager(logger, config.slackWebhook());