File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -379,12 +379,15 @@ public function mimeTypeIcon($mimetype): string {
379379 }
380380
381381 // Try only the first part of the filetype
382- $ mimePart = substr ($ icon , 0 , strpos ($ icon , '- ' ));
383- try {
384- $ this ->mimetypeIcons [$ mimetype ] = $ this ->urlGenerator ->imagePath ('core ' , 'filetypes/ ' . $ mimePart . '.svg ' );
385- return $ this ->mimetypeIcons [$ mimetype ];
386- } catch (\RuntimeException $ e ) {
387- // Image for the first part of the mimetype not found
382+
383+ if (strpos ($ icon , '- ' )) {
384+ $ mimePart = substr ($ icon , 0 , strpos ($ icon , '- ' ));
385+ try {
386+ $ this ->mimetypeIcons [$ mimetype ] = $ this ->urlGenerator ->imagePath ('core ' , 'filetypes/ ' . $ mimePart . '.svg ' );
387+ return $ this ->mimetypeIcons [$ mimetype ];
388+ } catch (\RuntimeException $ e ) {
389+ // Image for the first part of the mimetype not found
390+ }
388391 }
389392
390393 $ this ->mimetypeIcons [$ mimetype ] = $ this ->urlGenerator ->imagePath ('core ' , 'filetypes/file.svg ' );
You can’t perform that action at this time.
0 commit comments