--- a/src/js/init.js Thu Apr 12 18:41:11 2012 +0200
+++ b/src/js/init.js Mon Apr 16 14:21:57 2012 +0200
@@ -153,11 +153,10 @@
var ret_widgets = [];
var index;
-
- for (index = 0; index < guiOptions.widgets.length; index++) {
+ for (index = 0; index < guiOptions.widgets.length; index++) {
var widget = IriSP.instantiateWidget(popcornInstance, serialFactory, layoutManager, guiOptions.widgets[index], default_options);
- ret_widgets.push(widget);
+ ret_widgets.push(widget);
};
return ret_widgets;
@@ -193,8 +192,12 @@
*/
IriSP.instantiateWidget = function(popcornInstance, serialFactory, layoutManager, widgetConfig, defaultOptions) {
- if (IriSP.null_or_undefined(defaultOptions))
+ if (IriSP.null_or_undefined(defaultOptions)) {
defaultOptions = {};
+ }
+ if (IriSP.null_or_undefined(widgetConfig)) {
+ return;
+ }
widgetConfig = IriSP.underscore.defaults(widgetConfig, defaultOptions);