Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
fix(select): Fix NPE by checking for controller existence.
Browse files Browse the repository at this point in the history
In some cases, the select could be removed from the DOM before some
of the cleanup code was executed. This caused a `.controller()` call
to return `null`, but we did not check for existence before using
the controller which resulted in null pointer exception.

Fixes #7079.

Closes #7560
  • Loading branch information
topherfangio authored and ThomasBurleson committed Mar 14, 2016
1 parent 9158589 commit c3b498f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/select/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -1280,7 +1280,7 @@ function SelectProvider($$interimElementProvider) {
var mdSelect = opts.selectCtrl;
if (mdSelect) {
var menuController = opts.selectEl.controller('mdSelectMenu');
mdSelect.setLabelText(menuController.selectedLabels());
mdSelect.setLabelText(menuController ? menuController.selectedLabels() : '');
mdSelect.triggerClose();
}
}
Expand Down

0 comments on commit c3b498f

Please sign in to comment.