mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 19:13:20 +08:00
Fix realm migration failures with presence of databased EF rulesets that don't exist on disk
This commit is contained in:
parent
4a51bab9ac
commit
f2d48d088d
@ -28,21 +28,15 @@ namespace osu.Game.Rulesets
|
|||||||
public Ruleset CreateInstance()
|
public Ruleset CreateInstance()
|
||||||
{
|
{
|
||||||
if (!Available)
|
if (!Available)
|
||||||
throw new RulesetLoadException(@"Ruleset not available");
|
return null;
|
||||||
|
|
||||||
var type = Type.GetType(InstantiationInfo);
|
var type = Type.GetType(InstantiationInfo);
|
||||||
|
|
||||||
if (type == null)
|
if (type == null)
|
||||||
throw new RulesetLoadException(@"Type lookup failure");
|
return null;
|
||||||
|
|
||||||
var ruleset = Activator.CreateInstance(type) as Ruleset;
|
var ruleset = Activator.CreateInstance(type) as Ruleset;
|
||||||
|
|
||||||
if (ruleset == null)
|
|
||||||
throw new RulesetLoadException(@"Instantiation failure");
|
|
||||||
|
|
||||||
// overwrite the pre-populated RulesetInfo with a potentially database attached copy.
|
|
||||||
// ruleset.RulesetInfo = this;
|
|
||||||
|
|
||||||
return ruleset;
|
return ruleset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user