Fix crash on invalid data in local cache.
This commit is contained in:
parent
276fe2169a
commit
39a02e649d
|
@ -150,14 +150,17 @@ DocumentData *Document::readFromStreamHelper(
|
|||
}
|
||||
}
|
||||
|
||||
const auto storage = std::get_if<StorageFileLocation>(
|
||||
&thumb->file().data);
|
||||
if ((stream.status() != QDataStream::Ok)
|
||||
|| (!dc && !access)
|
||||
|| !thumb
|
||||
|| !videoThumb
|
||||
|| (thumb->valid()
|
||||
&& (!storage || !storage->isDocumentThumbnail()))) {
|
||||
|| !videoThumb) {
|
||||
stream.setStatus(QDataStream::ReadCorruptData);
|
||||
return nullptr;
|
||||
}
|
||||
const auto storage = std::get_if<StorageFileLocation>(
|
||||
&thumb->file().data);
|
||||
if (thumb->valid()
|
||||
&& (!storage || !storage->isDocumentThumbnail())) {
|
||||
stream.setStatus(QDataStream::ReadCorruptData);
|
||||
// We can't convert legacy thumbnail location to modern, because
|
||||
// size letter ('s' or 'm') is lost, it was not saved in legacy.
|
||||
|
|
Loading…
Reference in New Issue