fix crash when downloading files repeatedly

This commit is contained in:
Martin Rotter 2021-10-15 08:26:27 +02:00
parent 28edff70a7
commit 0c2943e85e

View File

@ -320,7 +320,7 @@ void DownloadItem::downloadProgress(qint64 bytes_received, qint64 bytes_total) {
} }
qint64 DownloadItem::bytesTotal() const { qint64 DownloadItem::bytesTotal() const {
return m_reply->header(QNetworkRequest::ContentLengthHeader).toULongLong(); return m_reply == nullptr ? 0 : m_reply->header(QNetworkRequest::ContentLengthHeader).toULongLong();
} }
qint64 DownloadItem::bytesReceived() const { qint64 DownloadItem::bytesReceived() const {