]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/valtext.cpp
Applied patch [ 762033 ] wxTextValidator crashes when given a NULL wxString
[wxWidgets.git] / src / common / valtext.cpp
index 530772a890fc3d967eda09a4323f582863576678..90627aa28dc393b2e088dab9ac66a9098f208aaf 100644 (file)
@@ -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() ;