Skip to content

Commit

Permalink
prevent JS error when select has no options
Browse files Browse the repository at this point in the history
  • Loading branch information
caseyjhol committed Mar 21, 2019
1 parent 3b04c7c commit e542354
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/bootstrap-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -2042,7 +2042,7 @@
offset = this.$menuInner[0].scrollTop;
} else if (!that.multiple) {
var element = that.$element[0];
selectedIndex = element.options[element.selectedIndex].liIndex;
selectedIndex = (element.options[element.selectedIndex] || {}).liIndex;

if (typeof selectedIndex === 'number' && that.options.size !== false) {
offset = that.sizeInfo.liHeight * selectedIndex;
Expand Down

0 comments on commit e542354

Please sign in to comment.