diff options
author | Petr Mrázek <peterix@gmail.com> | 2013-12-10 07:22:22 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2013-12-10 07:22:22 +0100 |
commit | aa61bbe9e414648399aff2802df5b587dee1a084 (patch) | |
tree | ff7809bea445bb76c9fd27a3245e1b2cb7c72596 /logic/net | |
parent | 3f5c46a1c4b27e82976e0067e4ec2d6abfffd9ba (diff) | |
parent | 712b87c643bbd7bc4ed2cfd459d0b9fdb69e5f0d (diff) | |
download | MultiMC-aa61bbe9e414648399aff2802df5b587dee1a084.tar MultiMC-aa61bbe9e414648399aff2802df5b587dee1a084.tar.gz MultiMC-aa61bbe9e414648399aff2802df5b587dee1a084.tar.lz MultiMC-aa61bbe9e414648399aff2802df5b587dee1a084.tar.xz MultiMC-aa61bbe9e414648399aff2802df5b587dee1a084.zip |
Merge branch 'develop' of github.com:MultiMC/MultiMC5 into develop
Conflicts:
CMakeLists.txt
gui/MainWindow.cpp
Diffstat (limited to 'logic/net')
-rw-r--r-- | logic/net/MD5EtagDownload.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/logic/net/MD5EtagDownload.cpp b/logic/net/MD5EtagDownload.cpp index 7b77bfbf..4b9f52af 100644 --- a/logic/net/MD5EtagDownload.cpp +++ b/logic/net/MD5EtagDownload.cpp @@ -63,6 +63,15 @@ void MD5EtagDownload::start() request.setRawHeader(QString("If-None-Match").toLatin1(), m_expected_md5.toLatin1()); request.setHeader(QNetworkRequest::UserAgentHeader, "MultiMC/5.0 (Uncached)"); + // Go ahead and try to open the file. + // If we don't do this, empty files won't be created, which breaks the updater. + // Plus, this way, we don't end up starting a download for a file we can't open. + if (!m_output_file.open(QIODevice::WriteOnly)) + { + emit failed(index_within_job); + return; + } + auto worker = MMC->qnam(); QNetworkReply *rep = worker->get(request); |