From c92bd38c72cb986aace77ebcef928142b241fd98 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 26 Apr 2007 00:15:42 +0000 Subject: [PATCH] ensure there is a current cell before using it to try and get width/height git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@45647 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/grid.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 4bd5a22d97..ef02bf6b4e 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -9615,7 +9615,7 @@ void wxGrid::SetCellHighlightPenWidth(int width) // make any visible change if the the thickness is getting smaller. int row = m_currentCellCoords.GetRow(); int col = m_currentCellCoords.GetCol(); - if ( GetColWidth(col) <= 0 || GetRowHeight(row) <= 0 ) + if ( row == -1 || col == -1 || GetColWidth(col) <= 0 || GetRowHeight(row) <= 0 ) return; wxRect rect = CellToRect(row, col);