Skip to content

Commit 0aae31e

Browse files
authored
Merge pull request #16 from pl12133/issues/3
Issue 3: Allow scalar values
2 parents 841249b + f1fa8c1 commit 0aae31e

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)