From c7c3f337c2991ac754e806b50e2133e7ff18c458 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sun, 9 Feb 2020 20:39:06 +0100 Subject: [PATCH] Check index value with CHECK_MSG to avoid crashes --- include/wx/propgrid/propgrid.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/wx/propgrid/propgrid.h b/include/wx/propgrid/propgrid.h index 0e9daa0ad7..b7768fd2df 100644 --- a/include/wx/propgrid/propgrid.h +++ b/include/wx/propgrid/propgrid.h @@ -1155,6 +1155,7 @@ public: const wxPGCommonValue* GetCommonValue( unsigned int i ) const { + wxCHECK_MSG( i < m_commonValues.size(), NULL, "Invalid item index" ); return m_commonValues[i]; } @@ -1167,7 +1168,7 @@ public: // Returns label of given common value. wxString GetCommonValueLabel( unsigned int i ) const { - wxASSERT( GetCommonValue(i) ); + wxCHECK_MSG( i < m_commonValues.size(), wxString(), "Invalid item index" ); return GetCommonValue(i)->GetLabel(); }