From 6571ef791a039c5bc6eefd37e0de82e2538bbe7a Mon Sep 17 00:00:00 2001 From: Nikita Potapov <47923521+nikita-potapov@users.noreply.github.com> Date: Tue, 29 Nov 2022 08:40:25 +0400 Subject: [PATCH] fixed Remove #2 --- Boats/Boats/SetBoatsGeneric.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Boats/Boats/SetBoatsGeneric.cs b/Boats/Boats/SetBoatsGeneric.cs index fdd126b..d56326b 100644 --- a/Boats/Boats/SetBoatsGeneric.cs +++ b/Boats/Boats/SetBoatsGeneric.cs @@ -69,7 +69,7 @@ namespace Boats public T Remove(int position) { // Проверка позиции - if (Count == 0 || position < 0 || position >= _maxCount) + if (position < 0 || position >= Count) return null; T boat = _places[position]; _places.RemoveAt(position);