diff --git a/Netch/Utils/Configuration.cs b/Netch/Utils/Configuration.cs index 51efc352da..db6dd101f4 100644 --- a/Netch/Utils/Configuration.cs +++ b/Netch/Utils/Configuration.cs @@ -53,8 +53,7 @@ public static Setting ParseSetting(string text) #region Check Profile - foreach (var profile in settings.Profiles.Where(p => p.ServerRemark == string.Empty || p.ModeRemark == string.Empty)!) - settings.Profiles.Remove(profile); + settings.Profiles.RemoveAll(p => p.ServerRemark == string.Empty || p.ModeRemark == string.Empty); if (settings.Profiles.Any(p => settings.Profiles.Any(p1 => p1 != p && p1.Index == p.Index))) for (var i = 0; i < settings.Profiles.Count; i++) @@ -67,7 +66,9 @@ public static Setting ParseSetting(string text) catch (Exception e) { Logging.Error(e.ToString()); - return new Setting(); + Utils.Open(Logging.LogFile); + Environment.Exit(-1); + return null!; } }