Fix crash in reading saved peers.

This commit is contained in:
John Preston 2020-07-01 00:41:21 +04:00
parent 3c0694280f
commit 1a69627102

View File

@ -204,7 +204,7 @@ PeerData *readPeer(
const auto loaded = (peerId == selfId)
? session->user().get()
: session->data().peerLoaded(peerId);
const auto apply = (loaded->loadedStatus != PeerData::FullLoaded);
const auto apply = !loaded || (loaded->loadedStatus != PeerData::FullLoaded);
const auto result = loaded ? loaded : session->data().peer(peerId).get();
if (apply) {
result->loadedStatus = PeerData::FullLoaded;