summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gui/table.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/table.cpp b/src/gui/table.cpp
index 5ad3b5e1..c25856a2 100644
--- a/src/gui/table.cpp
+++ b/src/gui/table.cpp
@@ -500,7 +500,10 @@ gcn::Widget *GuiTable::getWidgetAt(int x, int y)
int GuiTable::getRowForY(int y)
{
- int row = y / getRowHeight();
+ int row = -1;
+
+ if (getRowHeight() > 0)
+ row = y / getRowHeight();
if (row < 0 || row >= mModel->getRows())
return -1;