X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0fba0ec77b2e319b56039a6fb09e15e251577ce6..e0176dd9fb716ad0a1a8804f0a93e16048f09054:/src/common/sckfile.cpp diff --git a/src/common/sckfile.cpp b/src/common/sckfile.cpp index c9f723a145..6118f10c01 100644 --- a/src/common/sckfile.cpp +++ b/src/common/sckfile.cpp @@ -43,7 +43,13 @@ wxFileProto::~wxFileProto() wxInputStream *wxFileProto::GetInputStream(const wxString& path) { - return new wxFileInputStream(wxURL::ConvertFromURI(path)); + wxFileInputStream* retval = new wxFileInputStream(wxURL::ConvertFromURI(path)); + if (retval->Ok()) { + return retval; + } else { + delete retval; + return 0; + } } #endif // wxUSE_STREAMS && wxUSE_PROTOCOL_FILE