Skip to content

Commit

Permalink
Fix #1096: editor crashing when passing an empty string as name
Browse files Browse the repository at this point in the history
  • Loading branch information
josdejong committed Aug 26, 2020
1 parent b48ec89 commit b214915
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
https://github.com/josdejong/jsoneditor


## not yet published, version 9.0.5

- Fix #1096: editor crashing when passing an empty string as `name`.


## 2020-08-15, version 9.0.4

- Updated dependencies to `ace-builds@1.4.12`, `ajv@6.12.3`.
Expand Down
4 changes: 2 additions & 2 deletions src/js/Node.js
Original file line number Diff line number Diff line change
Expand Up @@ -1852,8 +1852,8 @@ export class Node {
domField.title = tooltip
}

// make backgound color lightgray when empty
const isEmpty = (String(this.field) === '' && this.parent.type !== 'array')
// make background color lightgray when empty
const isEmpty = (String(this.field) === '' && this.parent && this.parent.type !== 'array')
if (isEmpty) {
addClassName(domField, 'jsoneditor-empty')
} else {
Expand Down

0 comments on commit b214915

Please sign in to comment.