diff --git a/apps/documenteditor/main/app/controller/ViewTab.js b/apps/documenteditor/main/app/controller/ViewTab.js index 0e544b79b..6558e36aa 100644 --- a/apps/documenteditor/main/app/controller/ViewTab.js +++ b/apps/documenteditor/main/app/controller/ViewTab.js @@ -246,8 +246,10 @@ define([ if (this.view) { var current_theme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId(), menu_item = _.findWhere(this.view.btnInterfaceTheme.menu.items, {value: current_theme}); - this.view.btnInterfaceTheme.menu.clearAll(); - menu_item.setChecked(true, true); + if ( menu_item ) { + this.view.btnInterfaceTheme.menu.clearAll(); + menu_item.setChecked(true, true); + } this.view.btnDarkDocument.setDisabled(!Common.UI.Themes.isDarkTheme()); } }, diff --git a/apps/presentationeditor/main/app/controller/ViewTab.js b/apps/presentationeditor/main/app/controller/ViewTab.js index 9fedc8a61..23d85f9f4 100644 --- a/apps/presentationeditor/main/app/controller/ViewTab.js +++ b/apps/presentationeditor/main/app/controller/ViewTab.js @@ -202,8 +202,10 @@ define([ if (this.view) { var current_theme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId(), menu_item = _.findWhere(this.view.btnInterfaceTheme.menu.items, {value: current_theme}); - this.view.btnInterfaceTheme.menu.clearAll(); - menu_item.setChecked(true, true); + if ( !!menu_item ) { + this.view.btnInterfaceTheme.menu.clearAll(); + menu_item.setChecked(true, true); + } } }, diff --git a/apps/spreadsheeteditor/main/app/controller/ViewTab.js b/apps/spreadsheeteditor/main/app/controller/ViewTab.js index 09d045e0b..8a09ef62b 100644 --- a/apps/spreadsheeteditor/main/app/controller/ViewTab.js +++ b/apps/spreadsheeteditor/main/app/controller/ViewTab.js @@ -284,8 +284,10 @@ define([ if (this.view) { var current_theme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId(), menu_item = _.findWhere(this.view.btnInterfaceTheme.menu.items, {value: current_theme}); - this.view.btnInterfaceTheme.menu.clearAll(); - menu_item.setChecked(true, true); + if ( !!menu_item ) { + this.view.btnInterfaceTheme.menu.clearAll(); + menu_item.setChecked(true, true); + } } }