projects
/
nextcloud-desktop.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
32b51a5
)
Handle properly null avatar
author
Kevin Ottens
<kevin.ottens@nextcloud.com>
Mon, 6 Jul 2020 12:16:28 +0000
(14:16 +0200)
committer
Kevin Ottens
<ervin@ipsquad.net>
Tue, 7 Jul 2020 16:07:33 +0000
(18:07 +0200)
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>
src/libsync/networkjobs.cpp
patch
|
blob
|
history
diff --git
a/src/libsync/networkjobs.cpp
b/src/libsync/networkjobs.cpp
index 2236b1f950de4aab06bc7634520b2fffde862710..24f27056cb2b3eb2f50e07bb2312be35efbb01f2 100644
(file)
--- 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);