mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 11:37:28 +08:00
Fallback to default skin if instantiation fails
This commit is contained in:
parent
3e28ab72ce
commit
487378f732
@ -47,7 +47,17 @@ namespace osu.Game.Skinning
|
||||
? typeof(LegacySkin)
|
||||
: Type.GetType(InstantiationInfo).AsNonNull();
|
||||
|
||||
return (Skin)Activator.CreateInstance(type, this, resources);
|
||||
try
|
||||
{
|
||||
return (Skin)Activator.CreateInstance(type, this, resources);
|
||||
}
|
||||
catch
|
||||
{
|
||||
// This defaults to triangles to catch the case where a user has a modified triangles skin.
|
||||
// If we ever add more default skins in the future this will need some kind of proper migration rather than
|
||||
// a single catch.
|
||||
return new DefaultSkinTriangles(this, resources);
|
||||
}
|
||||
}
|
||||
|
||||
public IList<RealmNamedFileUsage> Files { get; } = null!;
|
||||
|
Loading…
Reference in New Issue
Block a user