From 1f2f2fa1444a0769552c67a8b762556d50897620 Mon Sep 17 00:00:00 2001
From: Dean Herbert <pe@ppy.sh>
Date: Mon, 30 Jan 2017 15:15:56 +0900
Subject: [PATCH] Fix visualtests.

---
 osu.Game/Screens/Select/BeatmapInfoWedge.cs | 30 ++++++++++++++-------
 1 file changed, 20 insertions(+), 10 deletions(-)

diff --git a/osu.Game/Screens/Select/BeatmapInfoWedge.cs b/osu.Game/Screens/Select/BeatmapInfoWedge.cs
index 4e86819036..93280cbe4f 100644
--- a/osu.Game/Screens/Select/BeatmapInfoWedge.cs
+++ b/osu.Game/Screens/Select/BeatmapInfoWedge.cs
@@ -29,7 +29,7 @@ namespace osu.Game.Screens.Select
 
         private Container beatmapInfoContainer;
 
-        private OsuGame game;
+        private OsuGameBase game;
 
         public BeatmapInfoWedge()
         {
@@ -47,7 +47,7 @@ namespace osu.Game.Screens.Select
         }
 
         [BackgroundDependencyLoader]
-        private void load(OsuGame game)
+        private void load(OsuGameBase game)
         {
             this.game = game;
         }
@@ -64,17 +64,27 @@ namespace osu.Game.Screens.Select
             BeatmapSetInfo beatmapSetInfo = beatmap.BeatmapSetInfo;
             BeatmapInfo beatmapInfo = beatmap.BeatmapInfo;
 
-            string bpm = getBPMRange(beatmap.Beatmap);
-            string length = TimeSpan.FromMilliseconds(beatmap.Beatmap.HitObjects.Last().EndTime - beatmap.Beatmap.HitObjects.First().StartTime).ToString(@"m\:ss");
+            List<InfoLabel> labels = new List<InfoLabel>();
 
-            List<InfoLabel> labels = new List<InfoLabel>
+            if (beatmap.Beatmap != null)
             {
-                new InfoLabel(new BeatmapStatistic { Name = "Length", Content = length, Icon = FontAwesome.fa_clock_o }),
-                new InfoLabel(new BeatmapStatistic { Name = "BPM", Content = bpm, Icon = FontAwesome.fa_circle }),
-            };
+                labels.Add(new InfoLabel(new BeatmapStatistic
+                {
+                    Name = "Length",
+                    Icon = FontAwesome.fa_clock_o,
+                    Content = TimeSpan.FromMilliseconds(beatmap.Beatmap.HitObjects.Last().EndTime - beatmap.Beatmap.HitObjects.First().StartTime).ToString(@"m\:ss"),
+                }));
 
-            //get statistics fromt he current ruleset.
-            Ruleset.GetRuleset(beatmap.BeatmapInfo.Mode).GetBeatmapStatistics(beatmap).ForEach(s => labels.Add(new InfoLabel(s)));
+                labels.Add(new InfoLabel(new BeatmapStatistic
+                {
+                    Name = "BPM",
+                    Icon = FontAwesome.fa_circle,
+                    Content = getBPMRange(beatmap.Beatmap),
+                }));
+
+                //get statistics fromt he current ruleset.
+                Ruleset.GetRuleset(beatmap.BeatmapInfo.Mode).GetBeatmapStatistics(beatmap).ForEach(s => labels.Add(new InfoLabel(s)));
+            }
 
             (beatmapInfoContainer = new BufferedContainer
             {