From 2dfbf0cb12dcaebf8dd52b9066fcc70ef6d14f49 Mon Sep 17 00:00:00 2001 From: Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> Date: Sat, 13 Aug 2022 19:14:55 +0800 Subject: small fixes --- featureClass/featureManager.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'featureClass') diff --git a/featureClass/featureManager.js b/featureClass/featureManager.js index 92212be..09799c6 100644 --- a/featureClass/featureManager.js +++ b/featureClass/featureManager.js @@ -357,7 +357,12 @@ class FeatureManager { return; } - data = JSON.parse(data) + try { + data = JSON.parse(data) + } catch (e) { + ChatLib.chat(this.messagePrefix + "&cYour settings file corrupted and could not be read! Resetting to defaults.") + data = {} + } this.featureSettingsData = data @@ -541,7 +546,7 @@ class FeatureManager { let event = this.registerCustom("command", func, context) event.trigger.setName(commandName, true) - + if (completions) event.trigger.setName(commandName, true).setTabCompletions(completions) return event -- cgit