diff --git a/dlls/msi/tests/automation.c b/dlls/msi/tests/automation.c index 03154e1d322..2c741e8a99e 100644 --- a/dlls/msi/tests/automation.c +++ b/dlls/msi/tests/automation.c @@ -804,7 +804,7 @@ static HRESULT Installer_RegistryValueI(HKEY hkey, LPCWSTR szKey, int iValue, LP V_I4(&vararg) = iValue; hr = Installer_RegistryValue(hkey, szKey, vararg, &varresult, vtResult); - if (vtResult == VT_BSTR) lstrcpyW(szString, V_BSTR(&varresult)); + if (SUCCEEDED(hr) && vtResult == VT_BSTR) lstrcpyW(szString, V_BSTR(&varresult)); VariantClear(&varresult); return hr; }