From da08120ff47817538b8ba52c6b632e8adcb20923 Mon Sep 17 00:00:00 2001 From: j Date: Wed, 16 Mar 2016 08:28:12 +0100 Subject: [PATCH] selected item might be gone --- source/UI/js/Video/AnnotationPanel.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/UI/js/Video/AnnotationPanel.js b/source/UI/js/Video/AnnotationPanel.js index f9347af6..0eb82cc3 100644 --- a/source/UI/js/Video/AnnotationPanel.js +++ b/source/UI/js/Video/AnnotationPanel.js @@ -332,9 +332,10 @@ Ox.AnnotationPanel = function(options, self) { } }, hide: function() { - self.options.selected - ? getFolder(self.options.selected).gainFocus() - : that.triggerEvent('focus'); + var folder = self.options.selected + ? getFolder(self.options.selected) + : null; + folder ? folder.gainFocus() : that.triggerEvent('focus'); } }) .appendTo(self.$menubar);