diff options
author | Morris Jobke <hey@morrisjobke.de> | 2021-03-24 21:46:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-24 21:46:21 +0100 |
commit | 2a749882e72d75ef584a483cf0e0546ff5764993 (patch) | |
tree | 2445f658f7750fa868ae263fd2d6c16926028951 | |
parent | 6e40c2fb52976e268821ae365c52dbb5253430a9 (diff) | |
parent | db0e198fe0247f180313f486a919a91ca3244e98 (diff) | |
download | nextcloud-server-2a749882e72d75ef584a483cf0e0546ff5764993.tar.gz nextcloud-server-2a749882e72d75ef584a483cf0e0546ff5764993.zip |
Merge pull request #26282 from nextcloud/psalm/avatar/data
improve type handling of Avatar::generateAvatarFromSvg
-rw-r--r-- | lib/private/Avatar/Avatar.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/private/Avatar/Avatar.php b/lib/private/Avatar/Avatar.php index 09d08f930e6..f716c567c79 100644 --- a/lib/private/Avatar/Avatar.php +++ b/lib/private/Avatar/Avatar.php @@ -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; } |