From c71b3064bba08a16b29d6f6ba238da52092d6993 Mon Sep 17 00:00:00 2001 From: kenshin-samourai Date: Thu, 19 Nov 2020 17:29:09 +0100 Subject: [PATCH] check that jqxhr['responseJSON']['error'] is a string --- static/admin/lib/errors-utils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/static/admin/lib/errors-utils.js b/static/admin/lib/errors-utils.js index e32c528..106cd16 100644 --- a/static/admin/lib/errors-utils.js +++ b/static/admin/lib/errors-utils.js @@ -4,7 +4,8 @@ const lib_errors = { extractJqxhrErrorMsg: function(jqxhr) { let hasErrorMsg = ('responseJSON' in jqxhr) && (jqxhr['responseJSON'] != null) && - ('error' in jqxhr['responseJSON']) + ('error' in jqxhr['responseJSON']) && + (typeof jqxhr['responseJSON']['error'] == 'string') return hasErrorMsg ? jqxhr['responseJSON']['error'] : jqxhr.statusText },