From cdc7d3ffe6d2e3e35c10555f5326fcd770cb90fe Mon Sep 17 00:00:00 2001 From: Jeff Haynie Date: Thu, 1 Apr 2021 14:54:37 -0500 Subject: [PATCH] fix crash when the walker didnt match because n will be null --- src/types/YXmlFragment.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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