From: Robin Dunn Date: Thu, 26 Apr 2007 00:15:42 +0000 (+0000) Subject: ensure there is a current cell before using it to try and get width/height X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/1b3b96d84c2ab8f064e52f6186f1b05f0b445f13 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/trunk@45647 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index be6c466a26..e521109b0a 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -9662,7 +9662,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);