Skip to content
This repository was archived by the owner on Dec 12, 2021. It is now read-only.

Commit f5ce072

Browse files
committed
[BUGFIX] handle selectedIndex -1
1 parent 76ba6ad commit f5ce072

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.idea
12
.grunt
23
node_modules
34
lcov.info

validate.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,8 @@
568568
}
569569
}
570570
} else {
571-
value = v.sanitizeFormValue(input.options[input.selectedIndex].value, options);
571+
var _val = typeof input.options[input.selectedIndex] !== 'undefined' ? input.options[input.selectedIndex].value : '';
572+
value = v.sanitizeFormValue(_val, options);
572573
}
573574
values[input.name] = value;
574575
}

0 commit comments

Comments
 (0)