We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 165622e commit 16a3730Copy full SHA for 16a3730
src/cdk/a11y/aria-describer/aria-describer.ts
@@ -167,8 +167,8 @@ export class AriaDescriber implements OnDestroy {
167
// already a container on the page, but we don't have a reference to it. Clear the
168
// old container so we don't get duplicates. Doing this, instead of emptying the previous
169
// container, should be slightly faster.
170
- if (preExistingContainer) {
171
- preExistingContainer.parentNode!.removeChild(preExistingContainer);
+ if (preExistingContainer && preExistingContainer.parentNode) {
+ preExistingContainer.parentNode.removeChild(preExistingContainer);
172
}
173
174
messagesContainer = this._document.createElement('div');
0 commit comments