Skip to content

Commit f1fa8c1

Browse files
committed
Guard against undefined event.target and this in linkState callback.
1 parent 3fbc80f commit f1fa8c1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default function linkState(component, key, eventPath) {
1414
let t = e && e.target || this,
1515
state = {},
1616
obj = state,
17-
v = typeof eventPath==='string' ? delve(e, eventPath) : t.nodeName ? (t.type.match(/^che|rad/) ? t.checked : t.value) : e,
17+
v = typeof eventPath==='string' ? delve(e, eventPath) : (t && t.nodeName) ? (t.type.match(/^che|rad/) ? t.checked : t.value) : e,
1818
i = 0;
1919
for ( ; i<path.length-1; i++) {
2020
obj = obj[path[i]] || (obj[path[i]] = !i && component.state[path[i]] || {});

0 commit comments

Comments
 (0)