From 0b2f2d47ad20ce7c1f522d8e7811a906870d2446 Mon Sep 17 00:00:00 2001 From: Mahmut Gundogdu Date: Tue, 19 Aug 2025 16:45:17 +0300 Subject: [PATCH] Update loading.directive.ts --- .../theme-shared/src/lib/directives/loading.directive.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/theme-shared/src/lib/directives/loading.directive.ts b/npm/ng-packs/packages/theme-shared/src/lib/directives/loading.directive.ts index 9de000e15f..53b8e331f1 100644 --- a/npm/ng-packs/packages/theme-shared/src/lib/directives/loading.directive.ts +++ b/npm/ng-packs/packages/theme-shared/src/lib/directives/loading.directive.ts @@ -88,7 +88,7 @@ export class LoadingDirective implements OnInit, OnDestroy { ngOnInit() { if (!this.targetElement) { const { offsetHeight, offsetWidth } = this.elRef.nativeElement; - if (!offsetHeight && !offsetWidth && this.elRef.nativeElement.children.length) { + if (!offsetHeight && !offsetWidth && this.elRef.nativeElement.children?.length) { this.targetElement = this.elRef.nativeElement.children[0] as HTMLElement; } else { this.targetElement = this.elRef.nativeElement;