From 5d82d7661f8e3391ea03b2dbdb7f98677d24795a Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Fri, 6 Jul 2007 06:01:23 +0000 Subject: [PATCH] Fix AV after unsuccessful table renaming. --- source/childwin.pas | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/childwin.pas b/source/childwin.pas index 840b27c6..432034a8 100644 --- a/source/childwin.pas +++ b/source/childwin.pas @@ -3304,10 +3304,14 @@ begin ShowDBProperties(self); // re-select same item for i:=0 to ListTables.Items.Count-1 do + begin if ListTables.Items[i].Caption = S then + begin + ListTables.Selected := ListTables.Items[i]; + ListTables.Items[i].Focused := True; break; - ListTables.Selected := ListTables.Items[i]; - ListTables.Items[i].Focused := true; + end; + end; // Important! Otherwise OnEdited refreshes list too: abort; end;