From 0b02bbb11d4a7ab7d2a403f7435c8c05b9d989bc Mon Sep 17 00:00:00 2001 From: PiwEL Date: Wed, 29 Jul 2020 16:54:40 +0200 Subject: [PATCH] JSON data has to be defined to test for errors Robustness: json variable might be undefined. Firefox 68-78+ (Windows, Mac) calls the success function with no parameters when page is unloading, triggering an uncaught error. --- js/core/core.ajax.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/core/core.ajax.js b/js/core/core.ajax.js index d5272f4b3..a6884cedd 100644 --- a/js/core/core.ajax.js +++ b/js/core/core.ajax.js @@ -66,7 +66,7 @@ function _fnBuildAjax( oSettings, data, fn ) var baseAjax = { "data": data, "success": function (json) { - var error = json.error || json.sError; + var error = typeof json == 'undefined' || json.error || json.sError; if ( error ) { _fnLog( oSettings, 0, error ); }