improve type handling of Avatar::generateAvatarFromSv

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2021-03-24 17:09:53 +01:00
parent 6e40c2fb52
commit db0e198fe0
No known key found for this signature in database
GPG Key ID: 42B69D8A64526EFB
1 changed files with 3 additions and 2 deletions

View File

@ -156,8 +156,9 @@ abstract class Avatar implements IAvatar {
$avatar->readImageBlob($svg);
$avatar->setImageFormat('png');
$image = new OC_Image();
$image->loadFromData($avatar);
return $image->data();
$image->loadFromData((string)$avatar);
$data = $image->data();
return $data === null ? false : $data;
} catch (\Exception $e) {
return false;
}