Skip to content

Commit e332d3b

Browse files
Ir00manAkryum
andcommitted
fix: Cannot read property of undefined issue (#995)
* Fixing Cannot read property of undefined issue #994 * chore: check object first Co-authored-by: Guillaume Chau <[email protected]>
1 parent 6421101 commit e332d3b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/util.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ export function has (object, path, parent = false) {
546546

547547
const sections = Array.isArray(path) ? path : path.split('.')
548548
const size = !parent ? 1 : 2
549-
while (sections.length > size) {
549+
while (object && sections.length > size) {
550550
object = object[sections.shift()]
551551
}
552552
return object != null && object.hasOwnProperty(sections[0])

0 commit comments

Comments
 (0)