Fix #657: `onClassName` throwing an error when a node is removed

This commit is contained in:
jos 2019-02-14 20:42:23 +01:00
parent c28cef0a9a
commit 53a4f57dda
2 changed files with 2 additions and 1 deletions

View File

@ -8,6 +8,7 @@ https://github.com/josdejong/jsoneditor
- Improved JSON schema titles on fields. Fixes #321. Thanks @AdamVig.
- Added Simplified Chinese localization. Thanks @long2ice.
- Added Turkish localization. Thanks @beratpostalci.
- Fix #657: `onClassName` throwing an error when a node is removed.
## 2019-01-23, version 5.28.2

View File

@ -932,7 +932,7 @@ Node.prototype._updateCssClassName = function () {
Node.prototype.recursivelyUpdateCssClassesOnNodes = function () {
this._updateCssClassName();
if (this.childs !== 'undefined') {
if (Array.isArray(this.childs)) {
for (var i = 0; i < this.childs.length; i++) {
this.childs[i].recursivelyUpdateCssClassesOnNodes();
}