diff --git a/osu.Game/Skinning/LegacySkin.cs b/osu.Game/Skinning/LegacySkin.cs index 5525cc483e..0e508e4527 100644 --- a/osu.Game/Skinning/LegacySkin.cs +++ b/osu.Game/Skinning/LegacySkin.cs @@ -60,10 +60,12 @@ private class LegacySkinResourceStore : IResourceStore private string getPathForFile(string filename) { + bool hasExtension = filename.Contains('.'); + string lastPiece = filename.Split('/').Last(); var file = skin.Files.FirstOrDefault(f => - string.Equals(Path.GetFileNameWithoutExtension(f.Filename), lastPiece, StringComparison.InvariantCultureIgnoreCase)); + string.Equals(hasExtension ? f.Filename : Path.GetFileNameWithoutExtension(f.Filename), lastPiece, StringComparison.InvariantCultureIgnoreCase)); return file?.FileInfo.StoragePath; } @@ -73,9 +75,17 @@ public LegacySkinResourceStore(SkinInfo skin, IResourceStore underlyingS this.underlyingStore = underlyingStore; } - public Stream GetStream(string name) => underlyingStore.GetStream(getPathForFile(name)); + public Stream GetStream(string name) + { + string path = getPathForFile(name); + return path == null ? null : underlyingStore.GetStream(path); + } - byte[] IResourceStore.Get(string name) => underlyingStore.Get(getPathForFile(name)); + byte[] IResourceStore.Get(string name) + { + string path = getPathForFile(name); + return path == null ? null : underlyingStore.Get(path); + } } } }