mirror of
https://github.com/osukey/osukey.git
synced 2025-07-20 01:40:02 +09:00
Gracefully handle missing type rather than triggering ArgumentNullException
This commit is contained in:
@ -129,7 +129,11 @@ namespace osu.Game.Rulesets
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var instanceInfo = ((Ruleset)Activator.CreateInstance(Type.GetType(r.InstantiationInfo).AsNonNull())).RulesetInfo;
|
var resolvedType = Type.GetType(r.InstantiationInfo);
|
||||||
|
|
||||||
|
if (resolvedType != null)
|
||||||
|
{
|
||||||
|
var instanceInfo = ((Ruleset)Activator.CreateInstance(resolvedType)).RulesetInfo;
|
||||||
|
|
||||||
r.Name = instanceInfo.Name;
|
r.Name = instanceInfo.Name;
|
||||||
r.ShortName = instanceInfo.ShortName;
|
r.ShortName = instanceInfo.ShortName;
|
||||||
@ -137,6 +141,7 @@ namespace osu.Game.Rulesets
|
|||||||
|
|
||||||
r.Available = true;
|
r.Available = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
r.Available = false;
|
r.Available = false;
|
||||||
|
Reference in New Issue
Block a user