Commit a286b479 authored by Rye Mutt's avatar Rye Mutt 🍞

Fix crash from unhandled json parser exception

parent a3f2f586
......@@ -598,6 +598,11 @@ LLSD HttpCoroJSONHandler::handleSuccess(LLCore::HttpResponse * response, LLCore:
{
bas >> jsonRoot;
}
catch (const nlohmann::json::exception& e)
{ // deserialization failed. Record the reason and pass back an empty map for markup.
status = LLCore::HttpStatus(499, std::string(e.what()));
return result;
}
catch (const std::runtime_error& e)
{ // deserialization failed. Record the reason and pass back an empty map for markup.
status = LLCore::HttpStatus(499, std::string(e.what()));
......@@ -626,6 +631,11 @@ LLSD HttpCoroJSONHandler::parseBody(LLCore::HttpResponse *response, bool &succes
{
bas >> jsonRoot;
}
catch (const nlohmann::json::exception&)
{
success = false;
return LLSD();
}
catch (const std::runtime_error&)
{
success = false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment