Skip to content

Commit 6731d9c

Browse files
mthorzenrunning-coder
authored andcommitted
First check that we find an input before accessing found elements (#457)
1 parent c4caf64 commit 6731d9c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/jquery.typeahead.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3780,9 +3780,6 @@
37803780

37813781
node = $(options.input);
37823782
}
3783-
if (typeof node[0].value === "undefined") {
3784-
node[0].value = node.text();
3785-
}
37863783
if (!node.length) {
37873784
// {debug}
37883785
_debug.log({
@@ -3797,6 +3794,9 @@
37973794

37983795
return;
37993796
}
3797+
if (typeof node[0].value === "undefined") {
3798+
node[0].value = node.text();
3799+
}
38003800

38013801
// #270 Forcing node.selector, the property was deleted from jQuery3
38023802
// In case of multiple init, each of the instances needs it's own selector!

0 commit comments

Comments
 (0)