From 407968bb7e2f86d11a5582b69bd284dcd5ce4768 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 24 Aug 2018 10:03:56 +0900 Subject: [PATCH 1/2] Log the format line when a decoder isn't found --- osu.Game/Beatmaps/Formats/Decoder.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Beatmaps/Formats/Decoder.cs b/osu.Game/Beatmaps/Formats/Decoder.cs index 2927654f62..759d6d14d1 100644 --- a/osu.Game/Beatmaps/Formats/Decoder.cs +++ b/osu.Game/Beatmaps/Formats/Decoder.cs @@ -55,11 +55,11 @@ namespace osu.Game.Beatmaps.Formats } while (line != null && line.Length == 0); if (line == null) - throw new IOException(@"Unknown file format"); + throw new IOException(@"Unknown file format (null)"); var decoder = typedDecoders.Select(d => line.StartsWith(d.Key) ? d.Value : null).FirstOrDefault(); if (decoder == null) - throw new IOException(@"Unknown file format"); + throw new IOException($@"Unknown file format ({line})"); return (Decoder)decoder.Invoke(line); } From 55370165c0487e5a1cc606ab554fe7cb1e965b5b Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 24 Aug 2018 10:12:30 +0900 Subject: [PATCH 2/2] Compare with invariant culture --- osu.Game/Beatmaps/Formats/Decoder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Beatmaps/Formats/Decoder.cs b/osu.Game/Beatmaps/Formats/Decoder.cs index 759d6d14d1..6f45718390 100644 --- a/osu.Game/Beatmaps/Formats/Decoder.cs +++ b/osu.Game/Beatmaps/Formats/Decoder.cs @@ -57,7 +57,7 @@ namespace osu.Game.Beatmaps.Formats if (line == null) throw new IOException(@"Unknown file format (null)"); - var decoder = typedDecoders.Select(d => line.StartsWith(d.Key) ? d.Value : null).FirstOrDefault(); + var decoder = typedDecoders.Select(d => line.StartsWith(d.Key, StringComparison.InvariantCulture) ? d.Value : null).FirstOrDefault(); if (decoder == null) throw new IOException($@"Unknown file format ({line})");