From f58ea26eb5ef03a1b802ed472478a284c7c52806 Mon Sep 17 00:00:00 2001 From: Aleksandr4350 Date: Wed, 12 Jun 2024 17:36:43 +0400 Subject: [PATCH] lab 7/0 --- .../CollectionGenericObjects/StorageCollection.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ProjectSportCar/ProjectSportCar/CollectionGenericObjects/StorageCollection.cs b/ProjectSportCar/ProjectSportCar/CollectionGenericObjects/StorageCollection.cs index 93ac2b7..fb5a3c1 100644 --- a/ProjectSportCar/ProjectSportCar/CollectionGenericObjects/StorageCollection.cs +++ b/ProjectSportCar/ProjectSportCar/CollectionGenericObjects/StorageCollection.cs @@ -90,9 +90,9 @@ public class StorageCollection public void SaveData(string filename) { - if (_storages.Count == 0) + if (_storages.Count < 1) { - throw new Exception("В хранилище отсутствуют коллекции для сохранения"); + throw new InvalidDataException("В хранилище отсутсвуют коллекции для сохранения"); } if (File.Exists(filename))