From 832f0beea91e9701acccf0f517a4706528bdc838 Mon Sep 17 00:00:00 2001 From: Programmist73 Date: Thu, 10 Nov 2022 22:47:29 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=BD=D0=B0=20=D0=BF=D1=83=D1=81=D1=82=D0=BE=D1=82?= =?UTF-8?q?=D1=83=20=D1=84=D0=B0=D0=B9=D0=BB=D0=BE=D0=B2=20=D1=81=D0=BE?= =?UTF-8?q?=D1=85=D1=80=D0=B0=D0=BD=D0=B5=D0=BD=D0=B8=D1=8F.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Airbus/Airbus/MapsCollection.cs | 6 +++--- Airbus/Airbus/SaveData.txt | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Airbus/Airbus/MapsCollection.cs b/Airbus/Airbus/MapsCollection.cs index a553232..a47df27 100644 --- a/Airbus/Airbus/MapsCollection.cs +++ b/Airbus/Airbus/MapsCollection.cs @@ -86,10 +86,10 @@ namespace Airbus using (StreamReader sr = new(filename)) { - string str = sr.ReadLine(); + string str = ""; - //если не содержит такую запись - if (!str.Contains("MapsCollection")) + //если не содержит такую запись или пустой файл + if ((str = sr.ReadLine()) == null || !str.Contains("MapsCollection")) { return false; } diff --git a/Airbus/Airbus/SaveData.txt b/Airbus/Airbus/SaveData.txt index 737d3b9..8b13789 100644 --- a/Airbus/Airbus/SaveData.txt +++ b/Airbus/Airbus/SaveData.txt @@ -1,3 +1 @@ -MapsCollection -123|StarWarsMap|1000:750:Yellow;1000:750:Lime:Red:True:True; -456|DesertStormMap|1000:750:Red;1000:750:Blue;1000:750:DeepPink:Lime:True:True; +