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) {