From 7ea2672a2bf4fc3e90a8849d5f44eb04500dce85 Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Fri, 13 Aug 2010 20:03:28 +0000 Subject: [PATCH] Add a safety check to avoid AVs in rare situations, where the number of db objects has been decreased from outside. Fixes issue #2114. --- source/main.pas | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/main.pas b/source/main.pas index 3e463e68..689ea3af 100644 --- a/source/main.pas +++ b/source/main.pas @@ -6681,7 +6681,8 @@ begin Objects := Connection.GetDBObjects(ActiveDatabase); ObjNode := DBtree.GetFirstChild(FindDBNode(ActiveDatabase)); while Assigned(ObjNode) do begin - if (Objects[ObjNode.Index].Name = FocusObject.Name) + if (Cardinal(Objects.Count) > ObjNode.Index) + and (Objects[ObjNode.Index].Name = FocusObject.Name) and (Objects[ObjNode.Index].NodeType = FocusObject.NodeType) then begin SelectNode(DBtree, ObjNode); end;