Merge pull request #33798 from nextcloud/backport/33332/stable24

[stable24] Fix handling of internal errors when uploading theming files
This commit is contained in:
blizzz 2022-09-27 08:46:36 +02:00 committed by GitHub
commit bd9ab80f87
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -137,7 +137,8 @@ window.addEventListener('DOMContentLoaded', function () {
},
fail: function (e, response){
var $form = $(e.target).closest('form');
OC.msg.finishedError('#theming_settings_msg', response._response.jqXHR.responseJSON.data.message);
const responseJSON = response._response.jqXHR.responseJSON;
OC.msg.finishedError('#theming_settings_msg', responseJSON && responseJSON.data && responseJSON.data.message ? responseJSON.data.message : t('theming', 'Error uploading the file'));
$form.find('label.button').addClass('icon-upload').removeClass('icon-loading-small');
$('#theming_settings_loading').hide();
}