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:
parent
653d7a50e5
commit
82b76851d5
@ -1002,6 +1002,12 @@ void wxTextCtrl::WriteText( const wxString &text )
|
|||||||
#else
|
#else
|
||||||
wxCharBuffer buffer( wxConvUTF8.cWC2MB( wxConvLocal.cWX2WC( text ) ) );
|
wxCharBuffer buffer( wxConvUTF8.cWC2MB( wxConvLocal.cWX2WC( text ) ) );
|
||||||
#endif
|
#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 );
|
gtk_editable_insert_text( GTK_EDITABLE(m_text), buffer, strlen(buffer), &len );
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
@ -1002,6 +1002,12 @@ void wxTextCtrl::WriteText( const wxString &text )
|
|||||||
#else
|
#else
|
||||||
wxCharBuffer buffer( wxConvUTF8.cWC2MB( wxConvLocal.cWX2WC( text ) ) );
|
wxCharBuffer buffer( wxConvUTF8.cWC2MB( wxConvLocal.cWX2WC( text ) ) );
|
||||||
#endif
|
#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 );
|
gtk_editable_insert_text( GTK_EDITABLE(m_text), buffer, strlen(buffer), &len );
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
Loading…
Reference in New Issue
Block a user