1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 02:07:34 +08:00

Fix potential missing ruleset

This commit is contained in:
smoogipoo 2020-07-22 12:48:12 +09:00
parent aca4110e36
commit 6b7f05740e

View File

@ -176,6 +176,9 @@ namespace osu.Game.Beatmaps
/// <returns>The <see cref="StarDifficulty"/>.</returns>
private StarDifficulty computeDifficulty(in DifficultyCacheLookup key, BeatmapInfo beatmapInfo, RulesetInfo rulesetInfo)
{
// In the case that the user hasn't given us a ruleset, use the beatmap's default ruleset.
rulesetInfo ??= beatmapInfo.Ruleset;
try
{
var ruleset = rulesetInfo.CreateInstance();