From e7df93b37deb92118ae85f7d84226c6842aa305b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 10 Oct 2008 16:15:17 +0000 Subject: [PATCH] don't crash when the document contents can't be converted to the target encoding (#10064) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@56216 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/xml/xml.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/xml/xml.cpp b/src/xml/xml.cpp index 7a2d12b541..412511808e 100644 --- a/src/xml/xml.cpp +++ b/src/xml/xml.cpp @@ -759,6 +759,8 @@ inline static void OutputString(wxOutputStream& stream, const wxString& str, wxUnusedVar(convMem); const wxWX2MBbuf buf(str.mb_str(*(convFile ? convFile : &wxConvUTF8))); + if ( !buf ) + return; stream.Write((const char*)buf, strlen((const char*)buf)); #else // !wxUSE_UNICODE if ( convFile && convMem )