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

Commit 1d71928

Browse files
committed
fix(input): guard against null access on parentForm (Angular 1.3).
1 parent 80a8929 commit 1d71928

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components/input/input.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,10 @@ function inputTextareaDirective($mdUtil, $window, $mdAria) {
267267
}
268268

269269
var isErrorGetter = containerCtrl.isErrorGetter || function() {
270-
return ngModelCtrl.$invalid && (ngModelCtrl.$touched || ngModelCtrl.$$parentForm.$submitted);
270+
return ngModelCtrl.$invalid && (
271+
ngModelCtrl.$touched ||
272+
(ngModelCtrl.$$parentForm && ngModelCtrl.$$parentForm.$submitted)
273+
);
271274
};
272275

273276
scope.$watch(isErrorGetter, containerCtrl.setInvalid);

0 commit comments

Comments
 (0)