From d3fd3d73be8c9da238fba091f381104d49aa5a46 Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Sun, 31 Jul 2011 08:53:34 +0200 Subject: [PATCH] winhlp32: Better protect macros against not finding a help file. --- programs/winhlp32/macro.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/programs/winhlp32/macro.c b/programs/winhlp32/macro.c index 7f3328f47cb..0a1642c3a9e 100644 --- a/programs/winhlp32/macro.c +++ b/programs/winhlp32/macro.c @@ -575,11 +575,11 @@ void CALLBACK MACRO_JumpContext(LPCSTR lpszPath, LPCSTR lpszWindow, LONG context HLPFILE* hlpfile; WINE_TRACE("(\"%s\", \"%s\", %d)\n", lpszPath, lpszWindow, context); - hlpfile = WINHELP_LookupHelpFile(lpszPath); - /* Some madness: what user calls 'context', hlpfile calls 'map' */ - WINHELP_OpenHelpWindow(HLPFILE_PageByMap, hlpfile, context, - WINHELP_GetWindowInfo(hlpfile, lpszWindow), - SW_NORMAL); + if ((hlpfile = WINHELP_LookupHelpFile(lpszPath))) + /* Some madness: what user calls 'context', hlpfile calls 'map' */ + WINHELP_OpenHelpWindow(HLPFILE_PageByMap, hlpfile, context, + WINHELP_GetWindowInfo(hlpfile, lpszWindow), + SW_NORMAL); } void CALLBACK MACRO_JumpHash(LPCSTR lpszPath, LPCSTR lpszWindow, LONG lHash) @@ -591,9 +591,10 @@ void CALLBACK MACRO_JumpHash(LPCSTR lpszPath, LPCSTR lpszWindow, LONG lHash) hlpfile = MACRO_CurrentWindow()->page->file; else hlpfile = WINHELP_LookupHelpFile(lpszPath); - WINHELP_OpenHelpWindow(HLPFILE_PageByHash, hlpfile, lHash, - WINHELP_GetWindowInfo(hlpfile, lpszWindow), - SW_NORMAL); + if (hlpfile) + WINHELP_OpenHelpWindow(HLPFILE_PageByHash, hlpfile, lHash, + WINHELP_GetWindowInfo(hlpfile, lpszWindow), + SW_NORMAL); } static void CALLBACK MACRO_JumpHelpOn(void)