From 1ff459d995f685aa5a83fe2c1c4b8f0f3b56ed03 Mon Sep 17 00:00:00 2001 From: TheCodex6824 Date: Mon, 25 Apr 2022 14:08:27 -0400 Subject: [PATCH] Use suggested error handling --- launcher/minecraft/auth/Parsers.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/launcher/minecraft/auth/Parsers.cpp b/launcher/minecraft/auth/Parsers.cpp index ea882b564..47473899b 100644 --- a/launcher/minecraft/auth/Parsers.cpp +++ b/launcher/minecraft/auth/Parsers.cpp @@ -1,4 +1,5 @@ #include "Parsers.h" +#include "Json.h" #include #include @@ -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";