[BUGFIX] Ensure extension icon exists before calling ImageInfo 13/57413/2
authorNicole Cordes <typo3@cordes.co>
Thu, 28 Jun 2018 19:11:13 +0000 (21:11 +0200)
committerNicole Cordes <typo3@cordes.co>
Tue, 3 Jul 2018 09:39:56 +0000 (11:39 +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/57413
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
typo3/sysext/extensionmanager/Classes/Utility/ListUtility.php

index a8dec4d..58366db 100644 (file)
@@ -270,9 +270,14 @@ class ListUtility implements \TYPO3\CMS\Core\SingletonInterface
     {
         foreach ($extensions as &$properties) {
             $extIconPath = PATH_site . $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;