1
0
mirror of synced 2025-02-08 15:08:11 +01:00

fix: Exception being thrown while loading projects

Fixes #2091
This commit is contained in:
WerWolv 2025-01-28 23:23:22 +01:00
parent 141030344b
commit fee7a16692

View File

@ -22,7 +22,11 @@ namespace hex::plugin::builtin {
.basePath = "patches.json",
.required = false,
.load = [](prv::Provider *provider, const std::fs::path &basePath, const Tar &tar) {
auto json = nlohmann::json::parse(tar.readString(basePath));
auto content = tar.readString(basePath);
if (content.empty())
return true;
auto json = nlohmann::json::parse(content);
auto patches = json.at("patches").get<std::map<u64, u8>>();
for (const auto &[address, value] : patches) {