From c2632eb604c25f73e3352c20ec2e25047608f8bf Mon Sep 17 00:00:00 2001 From: Kevin Ottens Date: Mon, 6 Jul 2020 14:16:28 +0200 Subject: [PATCH] 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 --- src/libsync/networkjobs.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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); -- 2.30.2