Merge pull request #1557 from Trial97/curse_crash

This commit is contained in:
Sefa Eyeoglu 2023-08-21 23:04:45 +02:00 committed by GitHub
commit b1783d8fb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -932,6 +932,11 @@ void MainWindow::processURLs(QList<QUrl> urls)
// 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;
continue;
}
auto addonId = query.allQueryItemValues("addonId")[0];
auto fileId = query.allQueryItemValues("fileId")[0];