Skip to content

Commit 518c75e

Browse files
committed
Fix "Cannot read property 'nodeType' of null" error
1 parent 0580c0c commit 518c75e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

objgrep.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
if (i.match(regex)) {
3838
ret.push(newContext);
3939
}
40-
if (allow_dom || !(root[i].nodeType)) {
40+
if (allow_dom || !(root[i] && root[i].hasOwnProperty('nodeType'))) {
4141
try {
4242
ret = ret.concat(objgrep(
4343
root[i],

0 commit comments

Comments
 (0)