Merge pull request #289 from jhaynie/main

fix crash when the walker didn't match because n will be null
This commit is contained in:
Kevin Jahns 2021-04-02 23:11:48 +02:00 committed by GitHub
commit 45a9af96af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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 = n && n.content && /** @type {any} */ (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