From: Kevin Ottens Date: Mon, 6 Jul 2020 12:16:28 +0000 (+0200) Subject: Handle properly null avatar X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~222^2^2~106 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=c2632eb604c25f73e3352c20ec2e25047608f8bf;p=nextcloud-desktop.git Handle properly null avatar If we try to produce the avatar before we managed to connect we'd end up trying to paint in a null image. Just return early, which will allow the caller to do something else instead. Signed-off-by: Kevin Ottens --- diff --git a/src/libsync/networkjobs.cpp b/src/libsync/networkjobs.cpp index 2236b1f95..24f27056c 100644 --- a/src/libsync/networkjobs.cpp +++ b/src/libsync/networkjobs.cpp @@ -649,6 +649,10 @@ void AvatarJob::start() QImage AvatarJob::makeCircularAvatar(const QImage &baseAvatar) { + if (baseAvatar.isNull()) { + return {}; + } + int dim = baseAvatar.width(); QImage avatar(dim, dim, QImage::Format_ARGB32);