diff --git a/src/gui/tray/usermodel.cpp b/src/gui/tray/usermodel.cpp index effa6fa810194..b0bad6378535c 100644 --- a/src/gui/tray/usermodel.cpp +++ b/src/gui/tray/usermodel.cpp @@ -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;