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:
commit
45a9af96af
@ -83,7 +83,7 @@ export class YXmlTreeWalker {
|
|||||||
* @type {Item|null}
|
* @type {Item|null}
|
||||||
*/
|
*/
|
||||||
let n = this._currentNode
|
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
|
if (n !== null && (!this._firstCall || n.deleted || !this._filter(type))) { // if first call, we check if we can use the first item
|
||||||
do {
|
do {
|
||||||
type = /** @type {any} */ (n.content).type
|
type = /** @type {any} */ (n.content).type
|
||||||
|
Loading…
x
Reference in New Issue
Block a user