fix crash when the walker didnt match because n will be null

This commit is contained in:
Jeff Haynie 2021-04-01 14:54:37 -05:00
parent ac6a0e7667
commit cdc7d3ffe6
No known key found for this signature in database
GPG Key ID: 5E99CF381CC02640

View File

@ -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