From: Alexander Ebert Date: Tue, 11 Jun 2013 23:36:13 +0000 (+0200) Subject: Discarding meaningless error messages for AJAX requests X-Git-Tag: 2.0.0_Beta_4~64^2~2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c648d1385c6287496c04f1116c7be39c19adc9da;p=GitHub%2FWoltLab%2FWCF.git Discarding meaningless error messages for AJAX requests Some requests do not return anything, which is perfectly fine but causes empty error messages to be displayed. --- diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 25c912838e..99c5278017 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -1863,7 +1863,11 @@ WCF.Action.Proxy = Class.extend({ if (!this._suppressErrors && $showError !== false) { var $message = (textStatus === 'timeout') ? WCF.Language.get('wcf.global.error.timeout') : jqXHR.responseText; - $('

' + $message + '

').wcfDialog({ title: WCF.Language.get('wcf.global.error.title') }); + + // validate if $message is neither empty nor 'undefined' + if ($message && $message != 'undefined') { + $('

' + $message + '

').wcfDialog({ title: WCF.Language.get('wcf.global.error.title') }); + } } }