diff --git a/ArmoredCar/ArmoredCar/SetArmoredCarsGeneric.cs b/ArmoredCar/ArmoredCar/SetArmoredCarsGeneric.cs index a4057ec..1396bd9 100644 --- a/ArmoredCar/ArmoredCar/SetArmoredCarsGeneric.cs +++ b/ArmoredCar/ArmoredCar/SetArmoredCarsGeneric.cs @@ -60,7 +60,7 @@ namespace ArmoredCar /// public T Remove(int position) { - if (position < 0 || position >= _maxCount) + if (position < 0 || position >= Count) return null; T armoredCar = _places[position]; _places.RemoveAt(position); @@ -77,7 +77,7 @@ namespace ArmoredCar { get { - if (position < 0 || position >= _maxCount) + if (position < 0 || position >= Count) return null; return _places[position]; }