X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2776d7c3bd349e1c42de0c4da83c7f5b0cfab0ec..543f08a67631f2849872d5d3ee7cb99047718560:/src/html/htmlhelp_io.cpp diff --git a/src/html/htmlhelp_io.cpp b/src/html/htmlhelp_io.cpp index 78353f4725..89f9fb1194 100644 --- a/src/html/htmlhelp_io.cpp +++ b/src/html/htmlhelp_io.cpp @@ -127,7 +127,9 @@ void wxHtmlHelpController::LoadMSProject(HtmlBookRecord *book, wxFileSystem& fsy HP_TagHandler *handler = new HP_TagHandler(book); parser.AddTagHandler(handler); - f = fsys.OpenFile(contentsfile); + // Don't panic if no index or contensfile is supplied. + // (without contents is a bit useless, but leaving out the index is sometimes handy) + f = ( contentsfile.IsEmpty() ? NULL : fsys.OpenFile(contentsfile) ); if (f) { sz = f -> GetStream() -> GetSize(); buf = new char[sz+1]; @@ -140,7 +142,7 @@ void wxHtmlHelpController::LoadMSProject(HtmlBookRecord *book, wxFileSystem& fsy delete[] buf; } - f = fsys.OpenFile(indexfile); + f = ( indexfile.IsEmpty() ? NULL : fsys.OpenFile(indexfile) ); if (f) { sz = f -> GetStream() -> GetSize(); buf = new char[sz+1]; @@ -247,4 +249,4 @@ void wxHtmlHelpController::SaveCachedBook(HtmlBookRecord *book, wxOutputStream * } } -#endif \ No newline at end of file +#endif