From c46fcdb5f0afd760c3f1653f5182bb21713f0219 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Tue, 7 May 2013 17:35:40 +0100 Subject: grid demo: fixes index out of bounds error when deleting rows. We never checked to see if there are any rows to delete. --- examples/gui/gridtest/gridtest.lpr | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'examples/gui') diff --git a/examples/gui/gridtest/gridtest.lpr b/examples/gui/gridtest/gridtest.lpr index 465281b2..f2c0b017 100644 --- a/examples/gui/gridtest/gridtest.lpr +++ b/examples/gui/gridtest/gridtest.lpr @@ -92,7 +92,8 @@ end; procedure TMainForm.btnDelRowClicked(Sender: TObject); begin - stringgrid.DeleteRow(stringgrid.FocusRow); + if StringGrid.RowCount > 0 then + stringgrid.DeleteRow(stringgrid.FocusRow); end; procedure TMainForm.chkDisabledChange(Sender: TObject); -- cgit v1.2.3-70-g09d2