Don't crash if buffer null

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33622 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart 2005-04-15 14:12:33 +00:00
parent 653d7a50e5
commit 82b76851d5
2 changed files with 12 additions and 0 deletions

View File

@ -1002,6 +1002,12 @@ void wxTextCtrl::WriteText( const wxString &text )
#else
wxCharBuffer buffer( wxConvUTF8.cWC2MB( wxConvLocal.cWX2WC( text ) ) );
#endif
if ( !buffer )
{
// what else can we do? at least don't crash...
return;
}
gtk_editable_insert_text( GTK_EDITABLE(m_text), buffer, strlen(buffer), &len );
#else

View File

@ -1002,6 +1002,12 @@ void wxTextCtrl::WriteText( const wxString &text )
#else
wxCharBuffer buffer( wxConvUTF8.cWC2MB( wxConvLocal.cWX2WC( text ) ) );
#endif
if ( !buffer )
{
// what else can we do? at least don't crash...
return;
}
gtk_editable_insert_text( GTK_EDITABLE(m_text), buffer, strlen(buffer), &len );
#else