Very Temporary Fix for curseforge
This commit is contained in:
@ -71,11 +71,6 @@ bool Flame::File::parseFromBytes(const QByteArray& bytes)
|
||||
|
||||
fileName = Json::requireString(obj, "fileName");
|
||||
|
||||
QString rawUrl = Json::requireString(obj, "downloadUrl");
|
||||
url = QUrl(rawUrl, QUrl::TolerantMode);
|
||||
if (!url.isValid()) {
|
||||
throw JSONValidationError(QString("Invalid URL: %1").arg(rawUrl));
|
||||
}
|
||||
// This is a piece of a Flame project JSON pulled out into the file metadata (here) for convenience
|
||||
// It is also optional
|
||||
type = File::Type::SingleFile;
|
||||
@ -87,7 +82,16 @@ bool Flame::File::parseFromBytes(const QByteArray& bytes)
|
||||
// this is probably a mod, dunno what else could modpacks download
|
||||
targetFolder = "mods";
|
||||
}
|
||||
|
||||
if(!obj.contains("downloadUrl") || obj["downloadUrl"].isNull() || !obj["downloadUrl"].isString() || obj["downloadUrl"].toString().isEmpty()){
|
||||
//either there somehow is an emtpy string as a link, or it's null either way it's invalid
|
||||
//soft failing
|
||||
return false;
|
||||
}
|
||||
QString rawUrl = Json::requireString(obj, "downloadUrl");
|
||||
url = QUrl(rawUrl, QUrl::TolerantMode);
|
||||
if (!url.isValid()) {
|
||||
throw JSONValidationError(QString("Invalid URL: %1").arg(rawUrl));
|
||||
}
|
||||
resolved = true;
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user