Use CHECK, not ASSERT, in wxSizer::Replace() if item is NULL

This is a violation of function preconditions, so don't bother doing
anything in this case.
This commit is contained in:
Vadim Zeitlin 2020-07-05 23:15:05 +02:00
parent 31632c4fbb
commit 187cbf1efa

View File

@ -869,7 +869,7 @@ bool wxSizer::Replace( wxSizer *oldsz, wxSizer *newsz, bool recursive )
bool wxSizer::Replace( size_t old, wxSizerItem *newitem )
{
wxCHECK_MSG( old < m_children.GetCount(), false, wxT("Replace index is out of range") );
wxASSERT_MSG( newitem, wxT("Replacing with NULL item") );
wxCHECK_MSG( newitem, false, wxT("Replacing with NULL item") );
wxSizerItemList::compatibility_iterator node = m_children.Item( old );