hhctrl: Fix NULL pointer dereference in some failure cases.

This commit is contained in:
Tijl Coosemans 2008-04-28 22:41:47 +02:00 committed by Alexandre Julliard
parent 9cce789881
commit efa040119b
1 changed files with 9 additions and 6 deletions

View File

@ -123,14 +123,17 @@ HWND WINAPI HtmlHelpW(HWND caller, LPCWSTR filename, UINT command, DWORD_PTR dat
}
info = CreateHelpViewer(filename);
if(!info)
return NULL;
if (info)
if(!index)
index = info->WinType.pszFile;
res = NavigateToChm(info, info->pCHMInfo->szFile, index);
if(!res)
{
if (!index)
index = info->WinType.pszFile;
res = NavigateToChm(info, info->pCHMInfo->szFile, index);
if(!res)
ReleaseHelpViewer(info);
ReleaseHelpViewer(info);
return NULL;
}
return info->WinType.hwndHelp;
}