diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp index 1e907b3f4..f1cbf1092 100644 --- a/src/downloadmanager.cpp +++ b/src/downloadmanager.cpp @@ -1845,11 +1845,12 @@ void DownloadManager::writeData(DownloadInfo *info) if (info != nullptr) { qint64 ret = info->m_Output.write(info->m_Reply->readAll()); if (ret < info->m_Reply->size()) { + QString fileName = info->m_FileName; // m_FileName may be destroyed after setState setState(info, DownloadState::STATE_CANCELED); qCritical(QString("Unable to write download \"%2\" to drive (return %1)").arg(ret).arg(info->m_FileName).toLocal8Bit()); reportError(tr("Unable to write download to drive (return %1).\n" "Check the drive's available storage.\n\n" - "Canceling download \"%2\"...").arg(ret).arg(info->m_FileName)); + "Canceling download \"%2\"...").arg(ret).arg(fileName)); } } } \ No newline at end of file