diff --git a/core/js/oc-dialogs.js b/core/js/oc-dialogs.js index a6a9e7e57e..456cc34ed4 100644 --- a/core/js/oc-dialogs.js +++ b/core/js/oc-dialogs.js @@ -129,7 +129,9 @@ var OCdialogs = { modal: modal, buttons: buttonlist, close: function(event, ui) { - self.$filePicker.ocdialog('destroy').remove(); + try { + $(this).ocdialog('destroy').remove(); + } catch(e) {} self.$filePicker = null; } });