From c648d1385c6287496c04f1116c7be39c19adc9da Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 12 Jun 2013 01:36:13 +0200 Subject: [PATCH] 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. --- wcfsetup/install/files/js/WCF.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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') }); + } } } -- 2.20.1