diff --git a/components/ionLoading/ionLoading.js b/components/ionLoading/ionLoading.js index d8c8c31..c9d2306 100644 --- a/components/ionLoading/ionLoading.js +++ b/components/ionLoading/ionLoading.js @@ -33,13 +33,16 @@ IonLoading = { }, hide: function () { - var $loadingEl = $(this.view.firstNode()); - $loadingEl.removeClass('active'); + if (this.view) { + var $loadingEl = $(this.view.firstNode()); + $loadingEl.removeClass('active'); - Meteor.setTimeout(function () { - IonBackdrop.release(); - $loadingEl.removeClass('visible'); - Blaze.remove(this.view); - }.bind(this), 400); + Meteor.setTimeout(function () { + IonBackdrop.release(); + $loadingEl.removeClass('visible'); + Blaze.remove(this.view); + this.view = null; + }.bind(this), 400); + } } };