Browse Source

* fixed TCollection.FindItemID as suggested by "de" (mantis #11588)

git-svn-id: trunk@11301 -
Jonas Maebe 17 years ago
parent
commit
f3afd6d934
1 changed files with 1 additions and 1 deletions
  1. 1 1
      rtl/objpas/classes/collect.inc

+ 1 - 1
rtl/objpas/classes/collect.inc

@@ -301,13 +301,13 @@ function TCollection.FindItemID(ID: Integer): TCollectionItem;
 Var
 Var
           I : Longint;
           I : Longint;
 begin
 begin
-  Result:=Nil;
   For I:=0 to Fitems.Count-1 do
   For I:=0 to Fitems.Count-1 do
    begin
    begin
      Result:=TCollectionItem(FItems.items[I]);
      Result:=TCollectionItem(FItems.items[I]);
      If Result.Id=Id then
      If Result.Id=Id then
        exit;
        exit;
    end;
    end;
+  Result:=Nil;
 end;
 end;