From f4c217a47bed6eae204224c6a73cddb202aa6531 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Thu, 13 Feb 2014 17:19:31 -0500 Subject: [PATCH] Fix NPE in spotlight --- static/lib/jquery.spotlight.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/static/lib/jquery.spotlight.js b/static/lib/jquery.spotlight.js index fc98d9561..50463de34 100644 --- a/static/lib/jquery.spotlight.js +++ b/static/lib/jquery.spotlight.js @@ -42,11 +42,13 @@ if (settings.animate) { currentOverlay.animate({opacity: 0}, settings.speed, settings.easing, function () { - currentOverlay.remove(); - currentOverlay = null; + if (currentOverlay != null) { + currentOverlay.remove(); + currentOverlay = null; - // Trigger the onHide callback - settings.onHide.call(this); + // Trigger the onHide callback + settings.onHide.call(this); + } }); } else { currentOverlay.remove();