1
0
mirror of https://github.com/ppy/osu.git synced 2026-06-01 13:20:11 +08:00

Add source lookups for safety

This commit is contained in:
Dean Herbert
2019-08-31 16:56:32 +09:00
Unverified
parent 7406e00bfc
commit 3da5eb6c8b
@@ -110,9 +110,9 @@ namespace osu.Game.Rulesets.Osu.Skinning
return null;
}
public Texture GetTexture(string componentName) => null;
public Texture GetTexture(string componentName) => source.GetTexture(componentName);
public SampleChannel GetSample(ISampleInfo sample) => null;
public SampleChannel GetSample(ISampleInfo sample) => source.GetSample(sample);
public TValue GetValue<TConfiguration, TValue>(Func<TConfiguration, TValue> query) where TConfiguration : SkinConfiguration
=> configuration.Value is TConfiguration conf ? query.Invoke(conf) : default;