From b3f7d39398564bfb8d59bfd7b5d04fd34ba81313 Mon Sep 17 00:00:00 2001 From: Nick K Date: Fri, 21 Dec 2018 07:49:06 -0500 Subject: [PATCH] fix(popover): null check the ref before disposing (#1086) --- src/framework/theme/components/popover/popover.directive.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/framework/theme/components/popover/popover.directive.ts b/src/framework/theme/components/popover/popover.directive.ts index be0a49c206..c37814967f 100644 --- a/src/framework/theme/components/popover/popover.directive.ts +++ b/src/framework/theme/components/popover/popover.directive.ts @@ -162,7 +162,9 @@ export class NbPopoverDirective implements AfterViewInit, OnDestroy { ngOnDestroy() { this.alive = false; this.hide(); - this.ref.dispose(); + if (this.ref) { + this.ref.dispose(); + } } show() {