Revert Photo::getImageDataForPhoto return-type change

This commit is contained in:
Philipp 2021-08-10 21:39:29 +02:00
parent 51ebb1541a
commit eb035771f1
No known key found for this signature in database
GPG Key ID: 9A28B7D4FF5667BD

View File

@ -185,7 +185,7 @@ class Photo
* *
* @param array $photo Photo data. Needs at least 'id', 'type', 'backend-class', 'backend-ref' * @param array $photo Photo data. Needs at least 'id', 'type', 'backend-class', 'backend-ref'
* *
* @return \Friendica\Object\Image|string * @return \Friendica\Object\Image
* @throws \Friendica\Network\HTTPException\InternalServerErrorException * @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @throws \ImagickException * @throws \ImagickException
* @throws StorageException * @throws StorageException
@ -201,7 +201,7 @@ class Photo
// legacy data storage in "data" column // legacy data storage in "data" column
$i = self::selectFirst(['data'], ['id' => $photo['id']]); $i = self::selectFirst(['data'], ['id' => $photo['id']]);
if ($i === false) { if ($i === false) {
return ''; return null;
} }
$data = $i['data']; $data = $i['data'];
} else { } else {
@ -210,7 +210,7 @@ class Photo
$data = $backendClass->get($backendRef); $data = $backendClass->get($backendRef);
} catch (ReferenceStorageException $referenceStorageException) { } catch (ReferenceStorageException $referenceStorageException) {
DI::logger()->debug('No data found for photo', ['photo' => $photo, 'exception' => $referenceStorageException]); DI::logger()->debug('No data found for photo', ['photo' => $photo, 'exception' => $referenceStorageException]);
return ''; return null;
} }
} }
return $data; return $data;