From: Vadim Zeitlin Date: Fri, 2 Feb 2007 23:41:54 +0000 (+0000) Subject: fix assert when the control doesn't have a valid date initially (bug 1648192) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/0bdd807424210ce9b4c14bae5dcd2943fcb1b13a fix assert when the control doesn't have a valid date initially (bug 1648192) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44347 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/datectrl.cpp b/src/msw/datectrl.cpp index 438f347694..d6a4315352 100644 --- a/src/msw/datectrl.cpp +++ b/src/msw/datectrl.cpp @@ -259,7 +259,8 @@ void wxDatePickerCtrl::SetValue(const wxDateTime& dt) // we need to keep only the date part, times don't make sense for this // control (in particular, comparisons with other dates would fail) m_date = dt; - m_date.ResetTime(); + if ( m_date.IsValid() ) + m_date.ResetTime(); } wxDateTime wxDatePickerCtrl::GetValue() const