diff --git a/dlls/shell32/shelllink.c b/dlls/shell32/shelllink.c index aa84d92a0f6..f73c88016c8 100644 --- a/dlls/shell32/shelllink.c +++ b/dlls/shell32/shelllink.c @@ -1996,6 +1996,9 @@ static LPWSTR ShellLink_GetAdvertisedArg(LPCWSTR str) LPCWSTR p; DWORD len; + if( !str ) + return NULL; + p = strchrW( str, ':' ); if( !p ) return NULL; @@ -2057,8 +2060,8 @@ static HRESULT ShellLink_SetAdvertiseInfo(IShellLinkImpl *This, LPCWSTR str) return E_FAIL; } - /* we have to have at least one of these two for an advertised shortcut */ - if( !szComponent && !szProduct ) + /* we have to have a component for an advertised shortcut */ + if( !szComponent ) return E_FAIL; This->sComponent = ShellLink_GetAdvertisedArg( szComponent );