Skip to content

Commit c83ada1

Browse files
committed
fixed jdorn#823
1 parent bd4197a commit c83ada1

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

src/editors/object.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { AbstractEditor } from '../editor.js'
2-
import { extend, trigger, hasOwnProperty } from '../utilities.js'
2+
import { extend, hasOwnProperty, trigger } from '../utilities.js'
33
import rules from './object.css.js'
44

55
export class ObjectEditor extends AbstractEditor {
@@ -417,14 +417,17 @@ export class ObjectEditor extends AbstractEditor {
417417
/* Increase the grid width to account for padding */
418418
this.maxwidth += 1
419419

420-
this.schema.defaultProperties.forEach(key => {
421-
this.addObjectProperty(key, true)
420+
/* Check for array (eg. meta-schema options is an object) */
421+
if (Array.isArray(this.schema.defaultProperties)) {
422+
this.schema.defaultProperties.forEach(key => {
423+
this.addObjectProperty(key, true)
422424

423-
if (this.editors[key]) {
424-
this.minwidth = Math.max(this.minwidth, (this.editors[key].options.grid_columns || this.editors[key].getNumColumns()))
425-
this.maxwidth += (this.editors[key].options.grid_columns || this.editors[key].getNumColumns())
426-
}
427-
})
425+
if (this.editors[key]) {
426+
this.minwidth = Math.max(this.minwidth, (this.editors[key].options.grid_columns || this.editors[key].getNumColumns()))
427+
this.maxwidth += (this.editors[key].options.grid_columns || this.editors[key].getNumColumns())
428+
}
429+
})
430+
}
428431
}
429432

430433
/* Sort editors by propertyOrder */

0 commit comments

Comments
 (0)