Skip to content

Commit

Permalink
Ensure account pointer is valid when fetching avatars
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Cambra <[email protected]>
  • Loading branch information
claucambra committed Oct 21, 2024
1 parent 1479371 commit 6610f2a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/gui/tray/usermodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1645,8 +1645,9 @@ class ImageResponse : public QQuickImageResponse
const auto accountString = userIds.last();
const auto accountState = AccountManager::instance()->account(accountString);
Q_ASSERT(accountState);
if (!accountState) {
qCWarning(lcActivity) << "Account not found:" << accountString;
Q_ASSERT(accountState->account());
if (!accountState || !accountState->account()) {
qCWarning(lcActivity) << "Invalid account:" << accountString;
return;
}
const auto avatarSize = requestedSize.width() > 0 ? requestedSize.width() : 64;
Expand Down

0 comments on commit 6610f2a

Please sign in to comment.