From e39b7b8d354463d849de7b9d30feda00eb1a1fd4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 22 Mar 2018 12:58:02 +0900 Subject: [PATCH] Don't hard-crash when an unknown section is encountered in a legacy file --- osu.Game/Beatmaps/Formats/LegacyDecoder.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/osu.Game/Beatmaps/Formats/LegacyDecoder.cs b/osu.Game/Beatmaps/Formats/LegacyDecoder.cs index 67d497ba83..131c010c5c 100644 --- a/osu.Game/Beatmaps/Formats/LegacyDecoder.cs +++ b/osu.Game/Beatmaps/Formats/LegacyDecoder.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.IO; +using osu.Framework.Logging; using OpenTK.Graphics; namespace osu.Game.Beatmaps.Formats @@ -31,7 +32,11 @@ namespace osu.Game.Beatmaps.Formats if (line.StartsWith(@"[") && line.EndsWith(@"]")) { if (!Enum.TryParse(line.Substring(1, line.Length - 2), out section)) - throw new InvalidDataException($@"Unknown osu section {line}"); + { + Logger.Log($"Unknown section \"{line}\" in {beatmap}"); + section = Section.None; + } + continue; }