mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-01-29 07:59:26 -06:00
fix: Net request json parser throwing exceptions
This commit is contained in:
@@ -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) };
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user