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
This commit is contained in:
Vadim Zeitlin
2008-10-10 16:15:17 +00:00
parent d1de94e062
commit e7df93b37d

View File

@@ -759,6 +759,8 @@ inline static void OutputString(wxOutputStream& stream, const wxString& str,
wxUnusedVar(convMem); wxUnusedVar(convMem);
const wxWX2MBbuf buf(str.mb_str(*(convFile ? convFile : &wxConvUTF8))); const wxWX2MBbuf buf(str.mb_str(*(convFile ? convFile : &wxConvUTF8)));
if ( !buf )
return;
stream.Write((const char*)buf, strlen((const char*)buf)); stream.Write((const char*)buf, strlen((const char*)buf));
#else // !wxUSE_UNICODE #else // !wxUSE_UNICODE
if ( convFile && convMem ) if ( convFile && convMem )