diff --git a/Source/BoldLockRegions.pas b/Source/BoldLockRegions.pas index c89a740..0c32efe 100644 --- a/Source/BoldLockRegions.pas +++ b/Source/BoldLockRegions.pas @@ -485,8 +485,9 @@ procedure TBoldRegionLookup.AddRegionLookup(Regions: TBoldRegionLookup); var Region: TBoldRegion; begin - for Region in Regions do - AddIfNotInLookup(Region); + if not Regions.IsEmpty then + for Region in Regions do + AddIfNotInLookup(Region); end; constructor TBoldRegionLookup.Create; diff --git a/Source/BoldOptimisticLockingSupport.pas b/Source/BoldOptimisticLockingSupport.pas index 7bc2230..4fa7143 100644 --- a/Source/BoldOptimisticLockingSupport.pas +++ b/Source/BoldOptimisticLockingSupport.pas @@ -177,6 +177,8 @@ procedure TBoldOptimisticLockHandler.GetLockingValuesForRegions(Regions: TBoldRe var Traverser: TBoldIndexableListTraverser; begin + if Regions.IsEmpty then + exit; Traverser := Regions.CreateTraverser; while Traverser.MoveNext do begin @@ -446,6 +448,8 @@ procedure TBoldOptimisticLockHandler.AddRegionsObjectsToEnclosure( var Traverser: TBoldIndexableListTraverser; begin + if Regions.IsEmpty then + exit; Traverser := Regions.CreateTraverser; while Traverser.MoveNext do begin