Issue Bug Closed

#60773Fatal error: Call to a member function getName() on a non-object in typo3/sysext/core/Classes/Resource/ResourceStorage.php on line 1377`

Frank Nägler 08/04/14, 17:50 updated 10/02/18, 11:52

Description

this happens, because \TYPO3\CMS\Core\Resource\ResourceFactory::findByStorageAndIdentifier can return null, which is returned by \TYPO3\CMS\Core\Resource\ResourceFactory::getFileObjectByStorageAndIdentifier in line 410 in.

the return annotation of getFileObjectByStorageAndIdentifier is also wrong current value is return File|ProcessedFile but this should be return null|File|ProcessedFile

I think adding a check like if ($fileObject instanceof \TYPO3\CMS\Core\Resource\AbstractFile) { is the best way to fix it.

a hint from Helmut Hummel:
if getFilesInFolder should be able to return processed files, then this needs indeed to be fixed, as any old processed file (present in fs but not in db) will cause a fatal

Reviews 2