Only register hive when successful

This commit is contained in:
momo5502
2024-11-03 08:26:29 +01:00
parent 629f9998d7
commit e7148c91ae

View File

@@ -29,7 +29,11 @@ namespace
void register_hive(registry_manager::hive_map& hives,
const std::filesystem::path& key, const std::filesystem::path& file)
{
hives[canonicalize_path(key)] = std::make_unique<hive_parser>(file);
auto hive = std::make_unique<hive_parser>(file);
if (hive && hive->success())
{
hives[canonicalize_path(key)] = std::move(hive);
}
}
}