mirror of
https://github.com/ppy/osu
synced 2024-12-16 03:45:46 +00:00
Gracefully handle missing type rather than triggering ArgumentNullException
This commit is contained in:
parent
99d638677d
commit
ea536dea23
@ -129,13 +129,18 @@ namespace osu.Game.Rulesets
|
||||
{
|
||||
try
|
||||
{
|
||||
var instanceInfo = ((Ruleset)Activator.CreateInstance(Type.GetType(r.InstantiationInfo).AsNonNull())).RulesetInfo;
|
||||
var resolvedType = Type.GetType(r.InstantiationInfo);
|
||||
|
||||
r.Name = instanceInfo.Name;
|
||||
r.ShortName = instanceInfo.ShortName;
|
||||
r.InstantiationInfo = instanceInfo.InstantiationInfo;
|
||||
if (resolvedType != null)
|
||||
{
|
||||
var instanceInfo = ((Ruleset)Activator.CreateInstance(resolvedType)).RulesetInfo;
|
||||
|
||||
r.Available = true;
|
||||
r.Name = instanceInfo.Name;
|
||||
r.ShortName = instanceInfo.ShortName;
|
||||
r.InstantiationInfo = instanceInfo.InstantiationInfo;
|
||||
|
||||
r.Available = true;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user