From 25843b486cf5366576cfd414c66d85fb0bdbca28 Mon Sep 17 00:00:00 2001
From: Xiao Gui <xgui3783@gmail.com>
Date: Mon, 17 Sep 2018 12:44:33 +0200
Subject: [PATCH] bugfix: fix inputRegionPopover undefined error

---
 src/ui/banner/banner.component.ts | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/ui/banner/banner.component.ts b/src/ui/banner/banner.component.ts
index 1467c912c..7d01ae660 100644
--- a/src/ui/banner/banner.component.ts
+++ b/src/ui/banner/banner.component.ts
@@ -180,6 +180,11 @@ export class AtlasBanner implements OnDestroy{
 
   @HostListener('document:click',['$event'])
   closeRegion(event:MouseEvent){
+
+    /* region popover may not always be rendered */
+    if(!this.inputRegionPopover)
+      return
+      
     /* FF does not implement event.srcElement so use event.originalTarget to polyfill for FF */
     const contains = this.inputRegionPopover.nativeElement.contains(event.srcElement) || this.inputRegionPopover.nativeElement.contains((event as any).originalTarget)
     if(contains)
-- 
GitLab