Merge pull request #428 from trystan2k/bugfix/incorrectConditionOnModesArray
Add extra verification when creating JSON editor to avoid to look for…
This commit is contained in:
commit
15ed4da608
|
@ -130,7 +130,7 @@ JSONEditor.prototype._create = function (container, options, json) {
|
|||
this.options = options || {};
|
||||
this.json = json || {};
|
||||
|
||||
var mode = this.options.modes ? this.options.modes[0] : this.options.mode || 'tree';
|
||||
var mode = this.options.modes && this.options.modes.length > 0 ? this.options.modes[0] : this.options.mode || 'tree';
|
||||
this.setMode(mode);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue