From: Michael Tremer Date: Tue, 7 May 2019 16:35:05 +0000 (+0100) Subject: accounts: Do not try to resize when no avatar was uploaded X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0109451c1a72e66812cee2e141c2c00badb1bdb0;p=ipfire.org.git accounts: Do not try to resize when no avatar was uploaded Signed-off-by: Michael Tremer --- 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