From 5b9bd7ac6d8487b0a592296a6b1b44d75c3fe9f9 Mon Sep 17 00:00:00 2001 From: harukalover Date: Sun, 17 May 2009 05:47:28 +0000 Subject: [PATCH] Prevent an out of range exception from being thrown. (was commonly being thrown when commit was used on the last row of the grid) Originally committed to SVN as r2945. --- aegisub/src/base_grid.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/aegisub/src/base_grid.cpp b/aegisub/src/base_grid.cpp index 5b13947c4..3bef97cd3 100644 --- a/aegisub/src/base_grid.cpp +++ b/aegisub/src/base_grid.cpp @@ -224,6 +224,7 @@ void BaseGrid::ClearSelection() { ///////////////////////// // Is cell in selection? bool BaseGrid::IsInSelection(int row, int col) const { + if (row >= GetRows() || row < 0) return false; (void) col; try { return selMap.at(row);