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:
Jos de Jong 2017-07-10 19:47:15 +02:00 committed by GitHub
commit 15ed4da608
1 changed files with 1 additions and 1 deletions

View File

@ -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);
};