fix crash with invalid mrpack format
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com> (cherry picked from commit 1dd0728a58159bc835b2e7724a707776ae0b93ce)
This commit is contained in:
parent
577999bd35
commit
344ae87f25
@ -261,12 +261,14 @@ bool ModrinthCreationTask::createInstance()
|
|||||||
mod->setDetails(d);
|
mod->setDetails(d);
|
||||||
mods[file.hash.toHex()] = mod;
|
mods[file.hash.toHex()] = mod;
|
||||||
}
|
}
|
||||||
|
if (file.downloads.empty()) {
|
||||||
|
setError(tr("The file '%1' is missing a download link. This is invalid in the pack format.").arg(fileName));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
qDebug() << "Will try to download" << file.downloads.front() << "to" << file_path;
|
qDebug() << "Will try to download" << file.downloads.front() << "to" << file_path;
|
||||||
auto dl = Net::ApiDownload::makeFile(file.downloads.dequeue(), file_path);
|
auto dl = Net::ApiDownload::makeFile(file.downloads.dequeue(), file_path);
|
||||||
dl->addValidator(new Net::ChecksumValidator(file.hashAlgorithm, file.hash));
|
dl->addValidator(new Net::ChecksumValidator(file.hashAlgorithm, file.hash));
|
||||||
downloadMods->addNetAction(dl);
|
downloadMods->addNetAction(dl);
|
||||||
|
|
||||||
if (!file.downloads.empty()) {
|
if (!file.downloads.empty()) {
|
||||||
// FIXME: This really needs to be put into a ConcurrentTask of
|
// FIXME: This really needs to be put into a ConcurrentTask of
|
||||||
// MultipleOptionsTask's , once those exist :)
|
// MultipleOptionsTask's , once those exist :)
|
||||||
|
Loading…
Reference in New Issue
Block a user