BetterSettings: fix error handling crashing in some niche cases
This commit is contained in:
parent
840a8f1fdd
commit
a2acce55c3
1 changed files with 3 additions and 8 deletions
|
@ -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
|
// 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
|
// not in children
|
||||||
Layer(props: LayerProps) {
|
Layer(props: LayerProps) {
|
||||||
try {
|
if (!FocusLock || !ComponentDispatch) {
|
||||||
if (!FocusLock || !ComponentDispatch)
|
new Logger("BetterSettings").error("Failed to find some components");
|
||||||
throw new Error("Failed to fetch some webpack modules");
|
|
||||||
|
|
||||||
return Layer(props);
|
|
||||||
} catch (e) {
|
|
||||||
new Logger("BetterSettings").error("Failed to render Layer", e);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return props.children;
|
return <Layer {...props} />;
|
||||||
},
|
},
|
||||||
|
|
||||||
wrapMenu(list: SettingsEntry[]) {
|
wrapMenu(list: SettingsEntry[]) {
|
||||||
|
|
Loading…
Reference in a new issue