Add a safety check to avoid AVs in rare situations, where the number of db objects has been decreased from outside. Fixes issue #2114.

This commit is contained in:
Ansgar Becker
2010-08-13 20:03:28 +00:00
parent 88e7f7aa05
commit 7ea2672a2b

View File

@ -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;