Skip to content

Commit 857ae52

Browse files
committed
cleanup silent failure
1 parent 0c68808 commit 857ae52

File tree

1 file changed

+21
-17
lines changed

1 file changed

+21
-17
lines changed

intro.js

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -429,25 +429,29 @@
429429
}
430430

431431
function cleanup(){
432-
if(hint){
433-
hint.destroy();
434-
}
435-
backdrop.remove();
436-
if(base.currentStep.element){
437-
unhighlighElement(base.currentStep.element);
438-
}
439-
if(_.isArray(base.currentStep.highlightElements)){
440-
_.each(base.currentStep.highlightElements, function(element){
441-
unhighlighElement(element);
442-
});
443-
}
432+
try {
433+
if(hint){
434+
hint.destroy();
435+
}
436+
backdrop.remove();
437+
if(base.currentStep.element){
438+
unhighlighElement(base.currentStep.element);
439+
}
440+
if(_.isArray(base.currentStep.highlightElements)){
441+
_.each(base.currentStep.highlightElements, function(element){
442+
unhighlighElement(element);
443+
});
444+
}
444445

445-
if(modal){
446-
modal.destroy();
446+
if(modal){
447+
modal.destroy();
448+
}
449+
modal = null;
450+
hint = null;
451+
backdrop = null;
452+
} catch (e) {
453+
// silent failure
447454
}
448-
modal = null;
449-
hint = null;
450-
backdrop = null;
451455
}
452456

453457
function isFunction(value){

0 commit comments

Comments
 (0)