1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 07:42:57 +08:00

Fix crashes on custom skins due to extension-less file lookups

This commit is contained in:
Dean Herbert 2019-12-16 13:32:53 +09:00
parent f4ce703490
commit 9062fe1935

View File

@ -22,10 +22,8 @@ namespace osu.Game.Skinning
if (source.Files == null)
return null;
bool hasExtension = filename.Contains('.');
var file = source.Files.Find(f =>
string.Equals(hasExtension ? f.Filename : Path.ChangeExtension(f.Filename, null), filename, StringComparison.InvariantCultureIgnoreCase));
string.Equals(f.Filename, filename, StringComparison.InvariantCultureIgnoreCase));
return file?.FileInfo.StoragePath;
}