diff --git a/src/app/components/dialog/dialog.ts b/src/app/components/dialog/dialog.ts index 2d8fd9c1ec8..424a64f4844 100755 --- a/src/app/components/dialog/dialog.ts +++ b/src/app/components/dialog/dialog.ts @@ -598,7 +598,7 @@ export class Dialog implements AfterContentInit, OnInit, OnDestroy { return this.header !== null ? UniqueComponentId() + '_header' : null; } - focus(focusParentElement = this.contentViewChild.nativeElement) { + focus(focusParentElement = this.contentViewChild?.nativeElement) { let focusable = DomHandler.getFocusableElement(focusParentElement, '[autofocus]'); if (focusable) { this.zone.runOutsideAngular(() => {