aboutsummaryrefslogtreecommitdiff
path: root/launcher/modplatform/flame/PackManifest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/modplatform/flame/PackManifest.cpp')
-rw-r--r--launcher/modplatform/flame/PackManifest.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/launcher/modplatform/flame/PackManifest.cpp b/launcher/modplatform/flame/PackManifest.cpp
index e4f90c1a..3217a756 100644
--- a/launcher/modplatform/flame/PackManifest.cpp
+++ b/launcher/modplatform/flame/PackManifest.cpp
@@ -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,17 @@ bool Flame::File::parseFromBytes(const QByteArray& bytes)
// this is probably a mod, dunno what else could modpacks download
targetFolder = "mods";
}
+ QString rawUrl = Json::ensureString(obj, "downloadUrl");
+ if(rawUrl.isEmpty()){
+ //either there somehow is an emtpy string as a link, or it's null either way it's invalid
+ //soft failing
+ return false;
+ }
+ url = QUrl(rawUrl, QUrl::TolerantMode);
+ if (!url.isValid()) {
+ throw JSONValidationError(QString("Invalid URL: %1").arg(rawUrl));
+ }
resolved = true;
return true;
}