From e7148c91aee34f304fadcb62b4836de0b3c3f702 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Sun, 3 Nov 2024 08:26:29 +0100 Subject: [PATCH] Only register hive when successful --- src/windows-emulator/registry_manager.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/windows-emulator/registry_manager.cpp b/src/windows-emulator/registry_manager.cpp index 0008452c..c73f5f94 100644 --- a/src/windows-emulator/registry_manager.cpp +++ b/src/windows-emulator/registry_manager.cpp @@ -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(file); + auto hive = std::make_unique(file); + if (hive && hive->success()) + { + hives[canonicalize_path(key)] = std::move(hive); + } } }