closes #6791, if fileSize isn't passed in don't perform check

v1.18.x
Barış Soner Uşaklı 6 years ago
parent b2f812befa
commit 3554a0a725

@ -164,7 +164,7 @@ define('pictureCropper', ['translator', 'cropper', 'benchpress'], function (tran
var imageUrl; var imageUrl;
var imageType = file.type; var imageType = file.type;
var fileSize = data.hasOwnProperty('fileSize') && data.fileSize !== undefined ? parseInt(data.fileSize, 10) : false; var fileSize = data.hasOwnProperty('fileSize') && data.fileSize !== undefined ? parseInt(data.fileSize, 10) : false;
if (file.size > fileSize * 1024) { if (fileSize && file.size > fileSize * 1024) {
return app.alertError('[[error:file-too-big, ' + fileSize + ']]'); return app.alertError('[[error:file-too-big, ' + fileSize + ']]');
} }
reader.addEventListener('load', function () { reader.addEventListener('load', function () {

Loading…
Cancel
Save