forked from Github/PrismLauncher
Merge pull request #2293 from PrismLauncher/backport-2291-to-release-8.x
[Backport release-8.x] Fixed crash on invalid curseforge link on import
This commit is contained in:
commit
7b1c5a7e1a
1 changed files with 4 additions and 0 deletions
|
|
@ -123,6 +123,10 @@ void ImportPage::updateState()
|
|||
// need to find the download link for the modpack
|
||||
// format of url curseforge://install?addonId=IDHERE&fileId=IDHERE
|
||||
QUrlQuery query(url);
|
||||
if (query.allQueryItemValues("addonId").isEmpty() || query.allQueryItemValues("fileId").isEmpty()) {
|
||||
qDebug() << "Invalid curseforge link:" << url;
|
||||
return;
|
||||
}
|
||||
auto addonId = query.allQueryItemValues("addonId")[0];
|
||||
auto fileId = query.allQueryItemValues("fileId")[0];
|
||||
auto array = std::make_shared<QByteArray>();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue