Fix potential nullref.

This commit is contained in:
Dean Herbert
2017-04-26 18:32:40 +09:00
parent 867c16665b
commit b6f838f536

View File

@ -89,12 +89,12 @@ namespace osu.Game.Screens.Play
if (Beatmap == null)
Beatmap = beatmaps.GetWorkingBeatmap(BeatmapInfo, withStoryboard: true);
if ((Beatmap?.Beatmap?.HitObjects.Count ?? 0) == 0)
throw new Exception("No valid objects were found!");
if (Beatmap == null)
if (Beatmap?.Beatmap == null)
throw new Exception("Beatmap was not loaded");
if (Beatmap?.Beatmap?.HitObjects.Count == 0)
throw new Exception("No valid objects were found!");
ruleset = osu?.Ruleset.Value ?? Beatmap.BeatmapInfo.Ruleset;
rulesetInstance = ruleset.CreateInstance();