mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fix crash in reading StorageFileLocation.
This commit is contained in:
parent
4625e7613b
commit
16f1875fdc
1 changed files with 8 additions and 4 deletions
|
@ -376,10 +376,14 @@ std::optional<StorageFileLocation> StorageFileLocation::FromSerialized(
|
||||||
result._id = (result._type == Type::PeerPhoto)
|
result._id = (result._type == Type::PeerPhoto)
|
||||||
? DeserializePeerId(id).value
|
? DeserializePeerId(id).value
|
||||||
: id;
|
: id;
|
||||||
result._localId = field1;
|
result._localId = (result._type == Type::PeerPhoto)
|
||||||
result._inMessagePeerId = (field2 > 0)
|
? 0
|
||||||
? peerFromUser(UserId(field2))
|
: field1;
|
||||||
: peerFromChannel(ChannelId(-field2));
|
result._inMessagePeerId = (field2 && result._type == Type::PeerPhoto)
|
||||||
|
? ((field2 > 0)
|
||||||
|
? peerFromUser(UserId(field2))
|
||||||
|
: peerFromChannel(ChannelId(-field2)))
|
||||||
|
: PeerId();
|
||||||
}
|
}
|
||||||
|
|
||||||
return (stream.status() == QDataStream::Ok && result.valid())
|
return (stream.status() == QDataStream::Ok && result.valid())
|
||||||
|
|
Loading…
Add table
Reference in a new issue