Fix opening t.me/channel with min-loaded channels.

This commit is contained in:
John Preston 2023-07-21 18:06:00 +04:00
parent 30c73fbdf2
commit 06e49c6813
1 changed files with 2 additions and 1 deletions

View File

@ -1158,7 +1158,8 @@ UserData *Session::userByPhone(const QString &phone) const {
PeerData *Session::peerByUsername(const QString &username) const {
const auto uname = username.trimmed();
for (const auto &[peerId, peer] : _peers) {
if (!peer->userName().compare(uname, Qt::CaseInsensitive)) {
if (peer->isLoaded()
&& !peer->userName().compare(uname, Qt::CaseInsensitive)) {
return peer.get();
}
}