From: Julian Smart Date: Thu, 11 Dec 2003 08:51:17 +0000 (+0000) Subject: Applied patch [ 817665 ] make file: URL return 0 on GetInputStream() for missing... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/b1755cdb315fc7558f530e881660221a4ac78e3a Applied patch [ 817665 ] make file: URL return 0 on GetInputStream() for missing file git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24741 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- 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