aboutsummaryrefslogtreecommitdiff
path: root/launcher/minecraft/mod/tasks/LocalModParseTask.cpp
diff options
context:
space:
mode:
authorkumquat-ir <66188216+kumquat-ir@users.noreply.github.com>2022-07-18 14:05:23 -0400
committerkumquat-ir <66188216+kumquat-ir@users.noreply.github.com>2022-07-18 14:05:23 -0400
commit20b1723e78149c1f2ac4072cbd46997e9c5160fa (patch)
tree7d97c8bc2edfe5cb41b91e6d04ba36da8aa163e6 /launcher/minecraft/mod/tasks/LocalModParseTask.cpp
parentbe78afeee54a19cd0115e1d2ec63f3a3201a3940 (diff)
parentdec81c4f274dd8388d442062cf9fa18600aa850d (diff)
downloadPrismLauncher-20b1723e78149c1f2ac4072cbd46997e9c5160fa.tar.gz
PrismLauncher-20b1723e78149c1f2ac4072cbd46997e9c5160fa.tar.bz2
PrismLauncher-20b1723e78149c1f2ac4072cbd46997e9c5160fa.zip
merge origin/develop
Signed-off-by: kumquat-ir <66188216+kumquat-ir@users.noreply.github.com>
Diffstat (limited to 'launcher/minecraft/mod/tasks/LocalModParseTask.cpp')
-rw-r--r--launcher/minecraft/mod/tasks/LocalModParseTask.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/launcher/minecraft/mod/tasks/LocalModParseTask.cpp b/launcher/minecraft/mod/tasks/LocalModParseTask.cpp
index 3354732b..1519f49d 100644
--- a/launcher/minecraft/mod/tasks/LocalModParseTask.cpp
+++ b/launcher/minecraft/mod/tasks/LocalModParseTask.cpp
@@ -4,6 +4,7 @@
#include <QJsonObject>
#include <QJsonArray>
#include <QJsonValue>
+#include <QString>
#include <quazip/quazip.h>
#include <quazip/quazipfile.h>
#include <toml.h>
@@ -71,7 +72,13 @@ std::shared_ptr<ModDetails> ReadMCModInfo(QByteArray contents)
if(val.isUndefined()) {
val = jsonDoc.object().value("modListVersion");
}
- int version = val.toDouble();
+
+ int version = Json::ensureInteger(val, -1);
+
+ // Some mods set the number with "", so it's a String instead
+ if (version < 0)
+ version = Json::ensureString(val, "").toInt();
+
if (version != 2)
{
qCritical() << "BAD stuff happened to mod json:";