From db0e198fe0247f180313f486a919a91ca3244e98 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 24 Mar 2021 17:09:53 +0100 Subject: [PATCH] improve type handling of Avatar::generateAvatarFromSv Signed-off-by: Robin Appelman --- lib/private/Avatar/Avatar.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/private/Avatar/Avatar.php b/lib/private/Avatar/Avatar.php index 09d08f930e6c0..f716c567c79c1 100644 --- a/lib/private/Avatar/Avatar.php +++ b/lib/private/Avatar/Avatar.php @@ -156,8 +156,9 @@ protected function generateAvatarFromSvg(int $size) { $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; }