From 732717a7af294d5e616033ee5aa49e0d25f8ff6c Mon Sep 17 00:00:00 2001 From: Rye Mutt <rye@alchemyviewer.org> Date: Thu, 10 Sep 2020 03:27:05 -0400 Subject: [PATCH] Update json lib --- indra/deps/CMakeLists.txt | 2 +- indra/newview/lltranslate.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/deps/CMakeLists.txt b/indra/deps/CMakeLists.txt index 3b89c851798..a64802ae322 100644 --- a/indra/deps/CMakeLists.txt +++ b/indra/deps/CMakeLists.txt @@ -24,7 +24,7 @@ FetchContent_Declare( FetchContent_Declare( nlohmann_json GIT_REPOSITORY https://github.com/nlohmann/json.git - GIT_TAG v3.7.3 + GIT_TAG v3.9.1 ) FetchContent_Declare( absl diff --git a/indra/newview/lltranslate.cpp b/indra/newview/lltranslate.cpp index 6a9c93f3354..b09e75eeccd 100644 --- a/indra/newview/lltranslate.cpp +++ b/indra/newview/lltranslate.cpp @@ -344,7 +344,7 @@ void LLGoogleTranslationHandler::parseErrorResponse( int &status, std::string &err_msg) { - const nlohmann::json &error = root.value("error", nlohmann::json::value_t::null); + const nlohmann::json &error = root.at("error"); if (!error.is_object() || error.find("message") == error.end() || error.find("code") == error.end()) { return; @@ -362,7 +362,7 @@ bool LLGoogleTranslationHandler::parseTranslation( { // Json is prone to aborting the program on failed assertions, // so be super-careful and verify the response format. - const nlohmann::json &data = root.value("data", nlohmann::json::value_t::null); + const nlohmann::json &data = root.at("data"); if (!data.is_object() || data.find("translations") == data.end()) { return false; -- GitLab