diff --git a/include/wx/compositewin.h b/include/wx/compositewin.h index 9e7b5fd6a1..9ac62639c2 100644 --- a/include/wx/compositewin.h +++ b/include/wx/compositewin.h @@ -110,7 +110,11 @@ private: { wxWindow * const child = *i; - (child->*func)(arg); + // Allow NULL elements in the list, this makes the code of derived + // composite controls which may have optionally shown children + // simpler and it doesn't cost us much here. + if ( child ) + (child->*func)(arg); } } diff --git a/src/generic/datectlg.cpp b/src/generic/datectlg.cpp index f45dba82ab..7ee0b66c88 100644 --- a/src/generic/datectlg.cpp +++ b/src/generic/datectlg.cpp @@ -385,10 +385,8 @@ wxSize wxDatePickerCtrlGeneric::DoGetBestSize() const wxWindowList wxDatePickerCtrlGeneric::GetCompositeWindowParts() const { wxWindowList parts; - if (m_combo) - parts.push_back(m_combo); - if (m_popup) - parts.push_back(m_popup); + parts.push_back(m_combo); + parts.push_back(m_popup); return parts; }