提交 e332d3b7 编写于 作者: R Roman 提交者: Guillaume Chau

fix: Cannot read property of undefined issue (#995)

* Fixing Cannot read property of undefined issue

https://github.com/vuejs/vue-devtools/issues/994

* chore: check object first
Co-authored-by: NGuillaume Chau <guillaume.b.chau@gmail.com>
上级 6421101f
......@@ -546,7 +546,7 @@ export function has (object, path, parent = false) {
const sections = Array.isArray(path) ? path : path.split('.')
const size = !parent ? 1 : 2
while (sections.length > size) {
while (object && sections.length > size) {
object = object[sections.shift()]
}
return object != null && object.hasOwnProperty(sections[0])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册