aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/assets/javascript/core.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js
index 33f4021cb9..bd791e668c 100644
--- a/phpBB/assets/javascript/core.js
+++ b/phpBB/assets/javascript/core.js
@@ -262,10 +262,13 @@ phpbb.ajaxify = function(options) {
console.log('AJAX error. status: ' + textStatus + ', message: ' + errorThrown);
}
phpbb.clearLoadingTimeout();
- var errorText = false;
- var responseText = $.parseJSON(jqXHR.responseText);
- if (typeof responseText.message === 'string' && responseText.message.length > 0) {
- errorText = responseText.message;
+ var responseText, errorText = false;
+ try {
+ responseText = JSON.parse(jqXHR.responseText);
+ responseText = responseText.message;
+ } catch (e) {}
+ if (typeof responseText === 'string' && responseText.length > 0) {
+ errorText = responseText;
}
else if (typeof errorThrown === 'string' && errorThrown.length > 0) {
errorText = errorThrown;