diff --git a/src/html/chm.cpp b/src/html/chm.cpp
index 980c60c364..520457c24c 100644
--- a/src/html/chm.cpp
+++ b/src/html/chm.cpp
@@ -825,6 +825,8 @@ wxFSFile* wxChmFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs),
}
wxFileName leftFilename = wxFileSystem::URLToFileName(left);
+ if (!leftFilename.FileExists())
+ return NULL;
// Open a stream to read the content of the chm-file
s = new wxChmInputStream(leftFilename.GetFullPath(), right, true);