From 41e57526ba9ee090f4ff58d0841c46bcf18686a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=B3=D0=BE=D1=80=D1=8C=20=D0=93=D0=BE=D1=80=D0=B4?= =?UTF-8?q?=D0=B5=D0=B5=D0=B2?= <89176335310x@gmail.com> Date: Fri, 29 Dec 2023 10:55:57 +0400 Subject: [PATCH] GG --- ElectricLocomotive/ElectricLocomotive/FormLocomotiveConfig.cs | 1 - ElectricLocomotive/ElectricLocomotive/SetGeneric.cs | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/ElectricLocomotive/ElectricLocomotive/FormLocomotiveConfig.cs b/ElectricLocomotive/ElectricLocomotive/FormLocomotiveConfig.cs index 33c1044..87d18ad 100644 --- a/ElectricLocomotive/ElectricLocomotive/FormLocomotiveConfig.cs +++ b/ElectricLocomotive/ElectricLocomotive/FormLocomotiveConfig.cs @@ -30,7 +30,6 @@ namespace ElectricLocomotive panelColorBlue.MouseDown += PanelColor_MouseDown; buttonCancelObject.Click += (s, e) => Close(); - } public void AddEvent(Action ev) { diff --git a/ElectricLocomotive/ElectricLocomotive/SetGeneric.cs b/ElectricLocomotive/ElectricLocomotive/SetGeneric.cs index 92bc661..a308aca 100644 --- a/ElectricLocomotive/ElectricLocomotive/SetGeneric.cs +++ b/ElectricLocomotive/ElectricLocomotive/SetGeneric.cs @@ -25,8 +25,7 @@ namespace ProjectElectricLocomotive.Generics public int Insert(T loco, int position) { - if (_places.Count >= _maxCount) - throw new StorageOverflowException(_maxCount); + if (position < 0 || position >= _maxCount) {