diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 8ccd9c7798..8c9f843909 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -4049,7 +4049,8 @@ void wxListMainWindow::GetVisibleLinesRange(size_t *from, size_t *to) } } - wxASSERT_MSG( m_lineFrom <= m_lineTo && m_lineTo < GetItemCount(), + wxASSERT_MSG( IsEmpty() || + (m_lineFrom <= m_lineTo && m_lineTo < GetItemCount()), _T("GetVisibleLinesRange() returns incorrect result") ); if ( from )