[Kimchi-devel] [PATCH] [Wok 2/2] Issue #12: wokd start fails if plugin does not have ui/config/tab-ext.xml
archus at linux.vnet.ibm.com
archus at linux.vnet.ibm.com
Tue Dec 22 14:13:57 UTC 2015
From: Archana Singh <archus at linux.vnet.ibm.com>
retrieveTabs returns empty list if any installed
plugin does not have tab-ext.xml, so pluginTabs[0]
becomes undefine.
So added if length of pluginTabs is greater
than zero than push the pluginsTabs into tabs.
Signed-off-by: Archana Singh <archus at linux.vnet.ibm.com>
---
ui/js/src/wok.main.js | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/ui/js/src/wok.main.js b/ui/js/src/wok.main.js
index 3df6fee..2a41bc5 100644
--- a/ui/js/src/wok.main.js
+++ b/ui/js/src/wok.main.js
@@ -125,11 +125,13 @@ wok.main = function() {
function(i18nObj){ //i18n is not define by plugin
}, i18nUrl, true);
var pluginTabs = retrieveTabs(url);
- var func = pluginTabs[0].functionality
- if (functionalTabs.indexOf(func) == -1) {
- functionalTabs.push(pluginTabs[0].functionality)
+ if(pluginTabs.length > 0){
+ var func = pluginTabs[0].functionality
+ if (functionalTabs.indexOf(func) == -1) {
+ functionalTabs.push(pluginTabs[0].functionality)
+ }
+ tabs.push.apply(tabs, pluginTabs);
}
- tabs.push.apply(tabs, pluginTabs);
});
//redirect to empty page when no plugin installed
--
2.1.0
More information about the Kimchi-devel
mailing list