Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
fix(interimElement): make cancel and hide not fail when no element is…
Browse files Browse the repository at this point in the history
… shown
  • Loading branch information
rschmukler committed Oct 4, 2014
1 parent 4da5673 commit 6162156
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/services/interimElement/interimElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ function InterimElementFactory($q, $rootScope, $timeout, $rootElement, $animate,
*/
function hide(success) {
var interimElement = stack.shift();
interimElement.remove().then(function() {
interimElement && interimElement.remove().then(function() {
interimElement.deferred.resolve(success);
});
}
Expand All @@ -137,7 +137,7 @@ function InterimElementFactory($q, $rootScope, $timeout, $rootElement, $animate,
*/
function cancel(reason) {
var interimElement = stack.shift();
interimElement.remove().then(function() {
interimElement && interimElement.remove().then(function() {
interimElement.deferred.reject(reason);
});
}
Expand Down

0 comments on commit 6162156

Please sign in to comment.