From b4f2c5528311782446be534db3ec04aeb86fa414 Mon Sep 17 00:00:00 2001 From: Owen Rudge Date: Wed, 22 Jul 2009 00:48:28 -0300 Subject: [PATCH] winhlp32: Ensure win->page is not NULL when selecting Help on Help. --- programs/winhlp32/macro.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/programs/winhlp32/macro.c b/programs/winhlp32/macro.c index c2fc3ccc710..fdec6b3dfa5 100644 --- a/programs/winhlp32/macro.c +++ b/programs/winhlp32/macro.c @@ -446,10 +446,13 @@ static void CALLBACK MACRO_GotoMark(LPCSTR str) void CALLBACK MACRO_HelpOn(void) { - LPCSTR file; + WINHELP_WINDOW *win = MACRO_CurrentWindow(); + LPCSTR file = NULL; WINE_TRACE("()\n"); - file = MACRO_CurrentWindow()->page->file->help_on_file; + if (win && win->page && win->page->file) + file = win->page->file->help_on_file; + if (!file) file = (Globals.wVersion > 4) ? "winhlp32.hlp" : "winhelp.hlp";