From: Julian Smart Date: Thu, 10 Jul 2003 08:21:49 +0000 (+0000) Subject: Applied patch [ 762033 ] wxTextValidator crashes when given a NULL wxString X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/7f03dc28545e0ef61a9ccbbce005504bacde541b?ds=sidebyside;hp=3bb63e5c806e7ef549673822dc6e4d40aa9dbec9 Applied patch [ 762033 ] wxTextValidator crashes when given a NULL wxString git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21839 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/valtext.cpp b/src/common/valtext.cpp index 530772a890..90627aa28d 100644 --- a/src/common/valtext.cpp +++ b/src/common/valtext.cpp @@ -206,6 +206,9 @@ bool wxTextValidator::TransferToWindow(void) if( !CheckValidator() ) return FALSE; + if (!m_stringValue) + return TRUE; + wxTextCtrl *control = (wxTextCtrl *) m_validatorWindow ; control->SetValue(* m_stringValue) ; @@ -218,6 +221,9 @@ bool wxTextValidator::TransferFromWindow(void) if( !CheckValidator() ) return FALSE; + if (!m_stringValue) + return TRUE; + wxTextCtrl *control = (wxTextCtrl *) m_validatorWindow ; * m_stringValue = control->GetValue() ;