From a2acce55c34ddf3e0eafdfe7ecf747dcee859fb5 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Thu, 9 May 2024 03:04:03 +0200 Subject: [PATCH] BetterSettings: fix error handling crashing in some niche cases --- src/plugins/betterSettings/index.tsx | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/plugins/betterSettings/index.tsx b/src/plugins/betterSettings/index.tsx index 5836734e..c9bf070f 100644 --- a/src/plugins/betterSettings/index.tsx +++ b/src/plugins/betterSettings/index.tsx @@ -131,16 +131,11 @@ export default definePlugin({ // try catch will only catch errors in the Layer function (hence why it's called as a plain function rather than a component), but // not in children Layer(props: LayerProps) { - try { - if (!FocusLock || !ComponentDispatch) - throw new Error("Failed to fetch some webpack modules"); - - return Layer(props); - } catch (e) { - new Logger("BetterSettings").error("Failed to render Layer", e); + if (!FocusLock || !ComponentDispatch) { + new Logger("BetterSettings").error("Failed to find some components"); } - return props.children; + return ; }, wrapMenu(list: SettingsEntry[]) {