mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-25 22:46:04 +03:00
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:
parent
32b51a52ef
commit
c2632eb604
1 changed files with 4 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue