https://git.reactos.org/?p=reactos.git;a=commitdiff;h=40b45515a40bf29cf6ed1a4ad1eaedf7ad3ae281

commit 40b45515a40bf29cf6ed1a4ad1eaedf7ad3ae281
Author:     Timo Kreuzer <timo.kreu...@reactos.org>
AuthorDate: Tue Dec 3 12:40:01 2024 +0200
Commit:     Timo Kreuzer <timo.kreu...@reactos.org>
CommitDate: Sun Jan 19 09:02:58 2025 +0200

    [IERNONCE] Check m_RegKey before deleting a value from it
    
    This fixes an assert, when _DEBUG is defined.
---
 dll/win32/iernonce/registry.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/dll/win32/iernonce/registry.cpp b/dll/win32/iernonce/registry.cpp
index a5c764b6c58..c497b3d18f5 100644
--- a/dll/win32/iernonce/registry.cpp
+++ b/dll/win32/iernonce/registry.cpp
@@ -311,8 +311,11 @@ BOOL RunOnceExInstance::Exec(_In_opt_ HWND hwnd)
         m_SectionList[i].CloseAndDelete(m_RegKey);
     }
 
-    m_RegKey.DeleteValue(L"Title");
-    m_RegKey.DeleteValue(L"Flags");
+    if (m_RegKey)
+    {
+        m_RegKey.DeleteValue(L"Title");
+        m_RegKey.DeleteValue(L"Flags");
+    }
 
     // Notify the dialog all sections are handled.
     if (hwnd)

Reply via email to