diff --git a/Telegram/SourceFiles/data/data_document.cpp b/Telegram/SourceFiles/data/data_document.cpp index 39e53d404..c0c442f2e 100644 --- a/Telegram/SourceFiles/data/data_document.cpp +++ b/Telegram/SourceFiles/data/data_document.cpp @@ -379,7 +379,8 @@ void DocumentOpenClickHandler::Open( return; } - if (data->status != FileReady) return; + if (data->status != FileReady + && data->status != FileDownloadFailed) return; QString filename; if (!data->saveToCache() diff --git a/Telegram/SourceFiles/storage/file_download.cpp b/Telegram/SourceFiles/storage/file_download.cpp index fefdacb6c..2583d085a 100644 --- a/Telegram/SourceFiles/storage/file_download.cpp +++ b/Telegram/SourceFiles/storage/file_download.cpp @@ -945,7 +945,7 @@ int mtpFileLoader::finishSentRequestGetOffset(mtpRequestId requestId) { bool mtpFileLoader::feedPart(int offset, bytes::const_span buffer) { Expects(!_finished); - if (buffer.size()) { + if (!buffer.empty()) { if (_fileIsOpen) { auto fsize = _file.size(); if (offset < fsize) { @@ -978,7 +978,7 @@ bool mtpFileLoader::feedPart(int offset, bytes::const_span buffer) { } } } - if (!buffer.size() || (buffer.size() % 1024)) { // bad next offset + if (buffer.empty() || (buffer.size() % 1024)) { // bad next offset _lastComplete = true; } if (_sentRequests.empty()