diff --git a/dlls/comdlg32/filedlg.c b/dlls/comdlg32/filedlg.c index 6b79fcfc838..538358bd5f9 100644 --- a/dlls/comdlg32/filedlg.c +++ b/dlls/comdlg32/filedlg.c @@ -250,11 +250,10 @@ static BOOL get_config_key_string(HKEY hkey, const WCHAR *name, WCHAR **value) DWORD type, size; WCHAR *str; - if (hkey && !RegQueryValueExW(hkey, name, 0, &type, NULL, &size)) - { - if (type != REG_SZ && type != REG_EXPAND_SZ) - return FALSE; - } + if (RegQueryValueExW(hkey, name, 0, &type, NULL, &size)) + return FALSE; + if (type != REG_SZ && type != REG_EXPAND_SZ) + return FALSE; str = heap_alloc(size); if (RegQueryValueExW(hkey, name, 0, &type, (BYTE *)str, &size))