mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-10 22:31:40 +02:00
error handling
This commit is contained in:
@@ -106,6 +106,8 @@ QString Innoextract::getHashError(QString exeFile, QString binFile)
|
|||||||
QCryptographicHash hash(QCryptographicHash::Algorithm::Sha1);
|
QCryptographicHash hash(QCryptographicHash::Algorithm::Sha1);
|
||||||
if(hash.addData(&exe))
|
if(hash.addData(&exe))
|
||||||
exeHash = hash.result().toHex().toLower().toStdString();
|
exeHash = hash.result().toHex().toLower().toStdString();
|
||||||
|
else
|
||||||
|
return QString{}; // error with hashing
|
||||||
exeSize = exe.size();
|
exeSize = exe.size();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -117,6 +119,8 @@ QString Innoextract::getHashError(QString exeFile, QString binFile)
|
|||||||
QCryptographicHash hash(QCryptographicHash::Algorithm::Sha1);
|
QCryptographicHash hash(QCryptographicHash::Algorithm::Sha1);
|
||||||
if(hash.addData(&bin))
|
if(hash.addData(&bin))
|
||||||
binHash = hash.result().toHex().toLower().toStdString();
|
binHash = hash.result().toHex().toLower().toStdString();
|
||||||
|
else
|
||||||
|
return QString{}; // error with hashing
|
||||||
binSize = bin.size();
|
binSize = bin.size();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user