feature #3748: Do not add panel if the creation fails

This commit is contained in:
Daniel Molina committed 2015-05-19 19:39:34 +02:00
1 parent 8e02b33af6
commit a0739b7bc0
1 file changed
+13 -10
+13 -10
View File
@@ -542,16 +542,19 @@ define(function(require) {
active = true;
}
var panelInstance = new Panel(info);
panelInstances.push(panelInstance);
templatePanelsParams.push({
'panelName': panelName,
'icon': panelInstance.icon,
'title': panelInstance.title,
'html': panelInstance.html(),
'active': active
})
try {
var panelInstance = new Panel(info);
panelInstances.push(panelInstance);
templatePanelsParams.push({
'panelName': panelName,
'icon': panelInstance.icon,
'title': panelInstance.title,
'html': panelInstance.html(),
'active': active
})
} catch(err) {
console.log(err);
}
active = false;
}