From b0ffb50fdfba8abe499427f48d419e06d86f23bb Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Mon, 14 Sep 2015 15:44:43 -0700 Subject: [PATCH] Move assertion in AssetRequest below error checking If the request had an error then there is no reason the assertion should be true. --- libraries/networking/src/AssetRequest.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libraries/networking/src/AssetRequest.cpp b/libraries/networking/src/AssetRequest.cpp index c0e5f0b6f2..45e925389d 100644 --- a/libraries/networking/src/AssetRequest.cpp +++ b/libraries/networking/src/AssetRequest.cpp @@ -76,8 +76,6 @@ void AssetRequest::start() { auto assetClient = DependencyManager::get(); assetClient->getAsset(_hash, _extension, start, end, [this, start, end](bool responseReceived, AssetServerError serverError, const QByteArray& data) { - Q_ASSERT(data.size() == (end - start)); - if (!responseReceived) { _error = NetworkError; } else if (serverError != AssetServerError::NoError) { @@ -93,6 +91,7 @@ void AssetRequest::start() { break; } } else { + Q_ASSERT(data.size() == (end - start)); // we need to check the hash of the received data to make sure it matches what we expect if (hashData(data).toHex() == _hash) {