diff options
author | TheCodex6824 <thecodex6824@gmail.com> | 2022-04-25 14:08:27 -0400 |
---|---|---|
committer | TheCodex6824 <thecodex6824@gmail.com> | 2022-04-25 14:08:27 -0400 |
commit | 1ff459d995f685aa5a83fe2c1c4b8f0f3b56ed03 (patch) | |
tree | 70381cc636e8abc436dc6e6de3bad2bbab428ae5 | |
parent | a0bafa49520195512c388ebe8d5e5b307d0a10be (diff) | |
download | PrismLauncher-1ff459d995f685aa5a83fe2c1c4b8f0f3b56ed03.tar.gz PrismLauncher-1ff459d995f685aa5a83fe2c1c4b8f0f3b56ed03.tar.bz2 PrismLauncher-1ff459d995f685aa5a83fe2c1c4b8f0f3b56ed03.zip |
Use suggested error handling
-rw-r--r-- | launcher/minecraft/auth/Parsers.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/launcher/minecraft/auth/Parsers.cpp b/launcher/minecraft/auth/Parsers.cpp index ea882b56..47473899 100644 --- a/launcher/minecraft/auth/Parsers.cpp +++ b/launcher/minecraft/auth/Parsers.cpp @@ -1,4 +1,5 @@ #include "Parsers.h" +#include "Json.h" #include <QJsonDocument> #include <QJsonArray> @@ -285,7 +286,7 @@ bool parseMinecraftProfileMojang(QByteArray & data, MinecraftProfile &output) { return false; } - auto obj = doc.object(); + auto obj = Json::requireObject(doc, "mojang minecraft profile"); if(!getString(obj.value("id"), output.id)) { qWarning() << "Minecraft profile id is not a string"; return false; @@ -330,7 +331,7 @@ bool parseMinecraftProfileMojang(QByteArray & data, MinecraftProfile &output) { return false; } - obj = doc.object(); + obj = Json::requireObject(doc, "session texture payload"); auto textures = obj.value("textures"); if (!textures.isObject()) { qWarning() << "No textures array in response"; |