diff --git a/src/types/YXmlFragment.js b/src/types/YXmlFragment.js index 1fd060b0..6fc0564e 100644 --- a/src/types/YXmlFragment.js +++ b/src/types/YXmlFragment.js @@ -83,7 +83,7 @@ export class YXmlTreeWalker { * @type {Item|null} */ let n = this._currentNode - let type = /** @type {any} */ (n.content).type + let type = /** @type {any} */ n && n.content && (n.content).type if (n !== null && (!this._firstCall || n.deleted || !this._filter(type))) { // if first call, we check if we can use the first item do { type = /** @type {any} */ (n.content).type