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

Commit c3b498f

Browse files
topherfangioThomasBurleson
authored andcommitted
fix(select): Fix NPE by checking for controller existence.
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
1 parent 9158589 commit c3b498f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/select/select.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1280,7 +1280,7 @@ function SelectProvider($$interimElementProvider) {
12801280
var mdSelect = opts.selectCtrl;
12811281
if (mdSelect) {
12821282
var menuController = opts.selectEl.controller('mdSelectMenu');
1283-
mdSelect.setLabelText(menuController.selectedLabels());
1283+
mdSelect.setLabelText(menuController ? menuController.selectedLabels() : '');
12841284
mdSelect.triggerClose();
12851285
}
12861286
}

0 commit comments

Comments
 (0)