check that the stream is valid before using it in Load() and Save() (patch 1516432)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40285 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
e617d19d32
commit
97757cee26
@ -348,12 +348,16 @@ void wxXmlDocument::DoCopy(const wxXmlDocument& doc)
|
||||
bool wxXmlDocument::Load(const wxString& filename, const wxString& encoding)
|
||||
{
|
||||
wxFileInputStream stream(filename);
|
||||
if (!stream.Ok())
|
||||
return false;
|
||||
return Load(stream, encoding);
|
||||
}
|
||||
|
||||
bool wxXmlDocument::Save(const wxString& filename) const
|
||||
{
|
||||
wxFileOutputStream stream(filename);
|
||||
if (!stream.Ok())
|
||||
return false;
|
||||
return Save(stream);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user