Skip to content

Commit a99d8e9

Browse files
authored
fix(material/core): mark fields on HasErrorState as nullable (#28689)
Updates a couple of the fields on `HasErrorState` to be nullable to align them with the `_ErrorStateTracker`. Fixes #28688.
1 parent 8a18a26 commit a99d8e9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/material/core/common-behaviors/error-state.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ type CanUpdateErrorStateCtor = Constructor<CanUpdateErrorState> &
3333

3434
/** @docs-private */
3535
interface HasErrorState {
36-
_parentFormGroup: FormGroupDirective;
37-
_parentForm: NgForm;
36+
_parentFormGroup: FormGroupDirective | null;
37+
_parentForm: NgForm | null;
3838
_defaultErrorStateMatcher: ErrorStateMatcher;
3939

4040
// These properties are defined as per the `MatFormFieldControl` interface. Since
4141
// this mixin is commonly used with custom form-field controls, we respect the
4242
// properties (also with the public name they need according to `MatFormFieldControl`).
43-
ngControl: NgControl;
43+
ngControl: NgControl | null;
4444
stateChanges: Subject<void>;
4545
}
4646

0 commit comments

Comments
 (0)