From 1fc059273f1cfa4043882912194c6fafd58006b0 Mon Sep 17 00:00:00 2001 From: Dani Herrero Date: Thu, 13 Jul 2017 13:32:23 +0200 Subject: [PATCH] corregido error al destruir popover en searchBar --- client/salix/src/components/searchbar/searchbar.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/client/salix/src/components/searchbar/searchbar.js b/client/salix/src/components/searchbar/searchbar.js index 769fdbd73..5f3ad79be 100644 --- a/client/salix/src/components/searchbar/searchbar.js +++ b/client/salix/src/components/searchbar/searchbar.js @@ -29,8 +29,11 @@ export default class Controller { if (this.onSearch) this.onSearch(); - angular.element(this.child).scope().$destroy(); - angular.element(this.child).remove(); + if (angular.element(this.child)) { + if (angular.element(this.child).scope()) + angular.element(this.child).scope().$destroy(); + angular.element(this.child).remove(); + } delete this.child; } $onDestroy() {