From 5094014f97da777c92dbf2422886d6759e5bad8c Mon Sep 17 00:00:00 2001 From: Sinan997 Date: Mon, 20 May 2024 23:44:45 +0300 Subject: [PATCH] fix: add null check to focus method parameter in dialog.ts --- src/app/components/dialog/dialog.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(() => {