Skip to content

Commit

Permalink
fix: Net request json parser throwing exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
WerWolv committed Aug 21, 2022
1 parent 928fbe2 commit 389e53a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/libimhex/source/helpers/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,10 @@ namespace hex {
setCommonSettings(response, url, timeout);

auto responseCode = execute();

return Response<nlohmann::json> { responseCode.value_or(0), nlohmann::json::parse(response) };
if (!responseCode.has_value())
return Response<nlohmann::json> { 0, { } };
else
return Response<nlohmann::json> { responseCode.value_or(0), nlohmann::json::parse(response, nullptr, false, true) };
});
}

Expand Down

0 comments on commit 389e53a

Please sign in to comment.