Skip to content

Node.js based forum software built for the modern web

dont crash if data.responseJSON doesnt exist

barisusakli95b709c8066b
diff --git a/public/src/ajaxify.js b/public/src/ajaxify.js
index 4412d185b1..a2239dfbb2 100644
--- a/public/src/ajaxify.js
+++ b/public/src/ajaxify.js
@@ -110,13 +110,14 @@ $(document).ready(function() {
textStatus = err.textStatus;
if (data) {
- data.responseJSON.config = config;
var status = parseInt(data.status, 10);
if (status === 403 || status === 404 || status === 500 || status === 502 || status === 503) {
if (status === 502) {
status = 500;
}
-
+ if (data.responseJSON) {
+ data.responseJSON.config = config;
+ }
$('#footer, #content').removeClass('hide').addClass('ajaxifying');
return renderTemplate(url, status.toString(), data.responseJSON, callback);
} else if (status === 401) {