Index: branches/5.1.x/core/admin_templates/js/jquery/thickbox/thickbox.js =================================================================== diff -u -N -r13887 -r13895 --- branches/5.1.x/core/admin_templates/js/jquery/thickbox/thickbox.js (.../thickbox.js) (revision 13887) +++ branches/5.1.x/core/admin_templates/js/jquery/thickbox/thickbox.js (.../thickbox.js) (revision 13895) @@ -483,6 +483,11 @@ } TB.remove = function ($e, $on_close) { + if (TB.useStack && TB.windows.length == 0) { + // no windows opened, but TB.remove called -> ignore + return ; + } + var $last_window = TB.useStack && TB.windows.length <= 1; if ( !$.isFunction($on_close) && $.isFunction(TB.lastParams.onAfterClose) ) {