diff --git a/src/framework/theme/components/search/search.component.ts b/src/framework/theme/components/search/search.component.ts index 8871b9ec64..4d8ac5db6d 100644 --- a/src/framework/theme/components/search/search.component.ts +++ b/src/framework/theme/components/search/search.component.ts @@ -232,6 +232,7 @@ export class NbSearchComponent implements OnInit, AfterViewInit, OnDestroy { ]) .pipe( takeWhile(() => this.alive), + filter(([componentRef, data]: [ComponentRef, any]) => componentRef != null), filter(([componentRef, data]: [ComponentRef, any]) => !this.tag || data.tag === this.tag), ) .subscribe(([componentRef]: [ComponentRef]) => { @@ -252,6 +253,7 @@ export class NbSearchComponent implements OnInit, AfterViewInit, OnDestroy { ]) .pipe( takeWhile(() => this.alive), + filter(([componentRef, data]: [ComponentRef, any]) => componentRef != null), filter(([componentRef, data]: [ComponentRef, any]) => !this.tag || data.tag === this.tag), ) .subscribe(([componentRef]: [ComponentRef]) => {