add node existence check to NodePath#has - fixes #2800
This commit is contained in:
parent
1bfb7039e9
commit
f4fe578a6c
@ -70,7 +70,7 @@ export function matchesPattern(pattern: string, allowPartial?: boolean): boolean
|
||||
*/
|
||||
|
||||
export function has(key): boolean {
|
||||
let val = this.node[key];
|
||||
let val = this.node && this.node[key];
|
||||
if (val && Array.isArray(val)) {
|
||||
return !!val.length;
|
||||
} else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user