From 0109451c1a72e66812cee2e141c2c00badb1bdb0 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 7 May 2019 17:35:05 +0100 Subject: [PATCH] accounts: Do not try to resize when no avatar was uploaded Signed-off-by: Michael Tremer --- src/backend/accounts.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/backend/accounts.py b/src/backend/accounts.py index 42cb72de..f6b7dc6c 100644 --- a/src/backend/accounts.py +++ b/src/backend/accounts.py @@ -769,6 +769,10 @@ class Account(Object): def get_avatar(self, size=None): photo = self._get_bytes("jpegPhoto") + # Exit if no avatar is available + if not photo: + return + # Return the raw image if no size was requested if size is None: return photo -- 2.47.3