From b5777f5a87f3dd79461939422786a705a605766d Mon Sep 17 00:00:00 2001 From: Dan Salvato Date: Thu, 8 Feb 2024 19:35:39 -0700 Subject: [PATCH] Add safeguards to manual simple view sorting --- src/modules/main_menu/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/modules/main_menu/index.js b/src/modules/main_menu/index.js index 5d8f7f42..e64898d8 100644 --- a/src/modules/main_menu/index.js +++ b/src/modules/main_menu/index.js @@ -718,11 +718,11 @@ export default class MainMenu extends Module { // Force sorting root categories in this specific order // if simple view is enabled if ( this.settings.get('ffz.simple-view') ) { - tree['twitch_appearance'].sort = 2; - tree['channel'].sort = 3; - tree['player'].sort = 4; - tree['chat'].sort = 5; - tree['ffz'].sort = 6; + if ( tree['twitch_appearance'] ) tree['twitch_appearance'].sort = 2; + if ( tree['channel'] ) tree['channel'].sort = 3; + if ( tree['player'] ) tree['player'].sort = 4; + if ( tree['chat'] ) tree['chat'].sort = 5; + if ( tree['ffz'] ) tree['ffz'].sort = 6; } for(const key in tree) {