From e7fa9b0c107cdcef8a2b6022e4f45ad1b334df3d Mon Sep 17 00:00:00 2001 From: bogiord Date: Mon, 18 Jan 2016 17:13:38 +0200 Subject: [PATCH] Add nullptr checks to wxGridTableBase::Set(Row|Col)Attr wxGridTableBase::SetAttr (for cells) does check its attr parameter for nullptr, but the check was missing from the row and column functions. Adding it makes it possible to use a nullptr argument to reset the attributes. --- src/generic/grid.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index ac80d27ff3..ca1be3c23e 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -1055,7 +1055,8 @@ void wxGridTableBase::SetRowAttr(wxGridCellAttr *attr, int row) { if ( m_attrProvider ) { - attr->SetKind(wxGridCellAttr::Row); + if ( attr ) + attr->SetKind(wxGridCellAttr::Row); m_attrProvider->SetRowAttr(attr, row); } else @@ -1070,7 +1071,8 @@ void wxGridTableBase::SetColAttr(wxGridCellAttr *attr, int col) { if ( m_attrProvider ) { - attr->SetKind(wxGridCellAttr::Col); + if ( attr ) + attr->SetKind(wxGridCellAttr::Col); m_attrProvider->SetColAttr(attr, col); } else