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 <kevin.ottens@nextcloud.com>
This commit is contained in:
Kevin Ottens 2020-07-06 14:16:28 +02:00 committed by Kevin Ottens
parent 32b51a52ef
commit c2632eb604
1 changed files with 4 additions and 0 deletions

View File

@ -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);