Skip to content

Commit

Permalink
check if prevOption exists before setting selected (#2263)
Browse files Browse the repository at this point in the history
  • Loading branch information
caseyjhol committed Aug 1, 2019
1 parent b613599 commit 6cd4b92
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 @@ -2388,7 +2388,7 @@
}

if (!that.multiple) { // Deselect all others if not multi select box
prevOption.selected = false;
if (prevOption) prevOption.selected = false;
option.selected = true;
that.setSelected(clickedIndex, true);
} else { // Toggle the one we have chosen if we are multi select.
Expand Down

0 comments on commit 6cd4b92

Please sign in to comment.