Added fix to correctly parse non-array error messages

Some apps like the antivirus app return messages in a non-array format.
remotes/origin/stable6
Vincent Petry 2013-10-29 16:00:34 +07:00
parent b0b76fe064
commit 71cf83b314
1 changed files with 7 additions and 2 deletions

@ -334,8 +334,13 @@ $(document).ready(function() {
var result=$.parseJSON(response);
delete data.jqXHR;
if (typeof result[0] === 'undefined') {
if (result.status === 'error' && result.data && result.data.message){
data.textStatus = 'servererror';
data.errorThrown = result.data.message;
var fu = $(this).data('blueimp-fileupload') || $(this).data('fileupload');
fu._trigger('fail', e, data);
} else if (typeof result[0] === 'undefined') {
data.textStatus = 'servererror';
data.errorThrown = t('files', 'Could not get result from server.');
var fu = $(this).data('blueimp-fileupload') || $(this).data('fileupload');