Avoid assertion failure when typing into generic wxDatePickerCtrl

Don't call wxCalendarCtrl::SetDate() if the current date is invalid,
this would just result in an assertion failure.
This commit is contained in:
Vadim Zeitlin 2018-07-30 21:48:48 +02:00
parent e3a728d637
commit 9293634af1

View File

@ -192,6 +192,7 @@ private:
if ( (dt.IsValid() && (!dtOld.IsValid() || dt != dtOld)) || if ( (dt.IsValid() && (!dtOld.IsValid() || dt != dtOld)) ||
(!dt.IsValid() && dtOld.IsValid()) ) (!dt.IsValid() && dtOld.IsValid()) )
{ {
if ( dt.IsValid() )
SetDate(dt); SetDate(dt);
SendDateEvent(dt); SendDateEvent(dt);
} }