File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
app/code/Magento/Cms/Model/Wysiwyg/Images Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -415,7 +415,7 @@ public function getFilesCollection($path, $type = null)
415
415
$ mimeType = $ itemStats ['mimetype ' ] ?? $ this ->mime ->getMimeType ($ item ->getFilename ());
416
416
$ item ->setMimeType ($ mimeType );
417
417
418
- if ($ this ->isImage ($ item ->getBasename ())) {
418
+ if ($ this ->isImage ($ item ->getBasename ()) && $ item -> getSize () > 0 ) {
419
419
$ thumbUrl = $ this ->getThumbnailUrl ($ item ->getFilename (), true );
420
420
// generate thumbnail "on the fly" if it does not exists
421
421
if (!$ thumbUrl ) {
@@ -435,6 +435,12 @@ public function getFilesCollection($path, $type = null)
435
435
$ this ->logger ->notice (sprintf ("GetImageSize caused error: %s " , $ e ->getMessage ()));
436
436
}
437
437
} else {
438
+ $ this ->logger ->warning (
439
+ sprintf (
440
+ "The image %s is invalid and cannot be displayed in the gallery. " ,
441
+ $ item ->getBasename ()
442
+ )
443
+ );
438
444
$ thumbUrl = $ this ->_assetRepo ->getUrl (self ::THUMB_PLACEHOLDER_PATH_SUFFIX );
439
445
}
440
446
You can’t perform that action at this time.
0 commit comments