mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
Move assertion in AssetRequest below error checking
If the request had an error then there is no reason the assertion should be true.
This commit is contained in:
parent
15e3678eab
commit
b0ffb50fdf
1 changed files with 1 additions and 2 deletions
|
@ -76,8 +76,6 @@ void AssetRequest::start() {
|
||||||
auto assetClient = DependencyManager::get<AssetClient>();
|
auto assetClient = DependencyManager::get<AssetClient>();
|
||||||
assetClient->getAsset(_hash, _extension, start, end, [this, start, end](bool responseReceived, AssetServerError serverError,
|
assetClient->getAsset(_hash, _extension, start, end, [this, start, end](bool responseReceived, AssetServerError serverError,
|
||||||
const QByteArray& data) {
|
const QByteArray& data) {
|
||||||
Q_ASSERT(data.size() == (end - start));
|
|
||||||
|
|
||||||
if (!responseReceived) {
|
if (!responseReceived) {
|
||||||
_error = NetworkError;
|
_error = NetworkError;
|
||||||
} else if (serverError != AssetServerError::NoError) {
|
} else if (serverError != AssetServerError::NoError) {
|
||||||
|
@ -93,6 +91,7 @@ void AssetRequest::start() {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} 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
|
// we need to check the hash of the received data to make sure it matches what we expect
|
||||||
if (hashData(data).toHex() == _hash) {
|
if (hashData(data).toHex() == _hash) {
|
||||||
|
|
Loading…
Reference in a new issue