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

Commit f79186f

Browse files
committed
fix(input): check that containerCtrl.label is defined before accessing it
Fixes #10831
1 parent ff34149 commit f79186f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/components/input/input.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,9 +474,11 @@ function inputTextareaDirective($mdUtil, $window, $mdAria, $timeout, $mdGesture)
474474
function setupAttributeWatchers() {
475475
if (containerCtrl.label) {
476476
attr.$observe('required', function (value) {
477-
// We don't need to parse the required value, it's always a boolean because of angular's
477+
// We don't need to parse the required value, it's always a boolean because of AngularJS'
478478
// required directive.
479-
containerCtrl.label.toggleClass('md-required', value && !mdNoAsterisk);
479+
if (containerCtrl.label) {
480+
containerCtrl.label.toggleClass('md-required', value && !mdNoAsterisk);
481+
}
480482
});
481483
}
482484
}

0 commit comments

Comments
 (0)