From 1729b67061fe524fc5dc329669e40b1370072ecb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Thu, 19 Feb 2015 18:10:03 +0100 Subject: [PATCH] Fix Uncaught exception in config tab --- src/sunstone/public/js/plugins/config-tab.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/sunstone/public/js/plugins/config-tab.js b/src/sunstone/public/js/plugins/config-tab.js index 9c6c181cf4..a705b7635f 100644 --- a/src/sunstone/public/js/plugins/config-tab.js +++ b/src/sunstone/public/js/plugins/config-tab.js @@ -33,11 +33,15 @@ Config = { }, "isTabActionEnabled": function(tab_name, action_name, panel_name){ - var enabled; - if (panel_name) { - enabled = config['view']['tabs'][tab_name]['panel_tabs_actions'][panel_name][action_name]; - } else { - enabled = config['view']['tabs'][tab_name]['actions'][action_name]; + var enabled = false; + var config_tab = config['view']['tabs'][tab_name]; + + if (config_tab != undefined){ + if (panel_name) { + enabled = config_tab['panel_tabs_actions'][panel_name][action_name]; + } else { + enabled = config_tab['actions'][action_name]; + } } return enabled;