diff --git a/src/html/htmlpars.cpp b/src/html/htmlpars.cpp
index 42101a4c0e..2bfef86812 100644
--- a/src/html/htmlpars.cpp
+++ b/src/html/htmlpars.cpp
@@ -856,7 +856,8 @@ wxChar wxHtmlEntitiesParser::GetEntityChar(const wxString& entity)
wxFSFile *wxHtmlParser::OpenURL(wxHtmlURLType WXUNUSED(type),
const wxString& url) const
{
- return GetFS()->OpenFile(url);
+ return m_FS ? m_FS->OpenFile(url) : NULL;
+
}