[BUGFIX] Ensure extension icon exists before calling ImageInfo 93/57393/2
authorNicole Cordes <typo3@cordes.co>
Wed, 27 Jun 2018 10:07:39 +0000 (12:07 +0200)
committerNicole Cordes <typo3@cordes.co>
Thu, 28 Jun 2018 19:09:40 +0000 (21:09 +0200)
As the extension icon is not required, this patch prevents warnings
that are triggered because no image size can be fetched.

Resolves: #85363
Releases: master, 8.7
Change-Id: I4c98fbaed385b2f269e940b8531c45e948ab8d36
Reviewed-on: https://review.typo3.org/57393
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
typo3/sysext/extensionmanager/Classes/Utility/ListUtility.php

index d7a1add..413c931 100644 (file)
@@ -271,9 +271,14 @@ class ListUtility implements \TYPO3\CMS\Core\SingletonInterface
     {
         foreach ($extensions as &$properties) {
             $extIconPath = Environment::getPublicPath() . '/' . $properties['siteRelPath'] . $properties['ext_icon'];
-            $imageInfo = GeneralUtility::makeInstance(ImageInfo::class, $extIconPath);
-            $properties['ext_icon_width'] = $imageInfo->getWidth();
-            $properties['ext_icon_height'] = $imageInfo->getHeight();
+            if (@is_file($extIconPath)) {
+                $imageInfo = GeneralUtility::makeInstance(ImageInfo::class, $extIconPath);
+                $properties['ext_icon_width'] = $imageInfo->getWidth();
+                $properties['ext_icon_height'] = $imageInfo->getHeight();
+            } else {
+                $properties['ext_icon_width'] = 0;
+                $properties['ext_icon_height'] = 0;
+            }
         }
         unset($properties);
         return $extensions;