Merge pull request #3203 from PrismLauncher/backport-3181-to-release-9.x
[Backport release-9.x] fix crash with invalid mrpack format
This commit is contained in:
commit
a85720b8d6
@ -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