diff --git a/Quick.Collections.pas b/Quick.Collections.pas index 5757ad9..f7942a4 100644 --- a/Quick.Collections.pas +++ b/Quick.Collections.pas @@ -296,7 +296,7 @@ function TxList.ExtractItem(const Value: T; Direction: TDirection): T; function TxList.First: T; begin - Result := fList.First; + if fList.Count > 0 then Result := fList.First; end; procedure TxList.FromList(const aList: TList); @@ -377,7 +377,7 @@ procedure TxList.InsertRange(Index: Integer; const Values: array of T); function TxList.Last: T; begin - Result := fList.Last; + if fList.Count > 0 then Result := fList.Last; end; function TxList.LastIndexOf(const Value: T): Integer;