Commit 8372e362 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Make Conversation::avatar more resistant

If QIcon receives the cached image but still isn't usable, then provide
the fallback as well.
parent 836555ca
......@@ -128,10 +128,12 @@ QIcon Conversation::avatar() const
} else {
const QString path = d->targetContact->avatarData().fileName;
QIcon icon;
if (path.isEmpty()) {
icon = QIcon::fromTheme(QStringLiteral("im-user"));
} else
if (!path.isEmpty()) {
icon = QIcon(path);
}
if (icon.availableSizes().isEmpty()) {
icon = QIcon::fromTheme(QStringLiteral("im-user"));
}
return icon;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment