Fix possible nullref

This commit is contained in:
smoogipoo 2020-11-12 14:54:33 +09:00
parent 1f8d376b85
commit 16e4e8d032

View File

@ -7,6 +7,7 @@ using System.Diagnostics;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions.TypeExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Performance;
@ -71,6 +72,9 @@ namespace osu.Game.Rulesets.UI
Debug.Assert(!drawableMap.ContainsKey(entry));
var drawable = drawableRuleset.GetPooledDrawableRepresentation(entry.HitObject);
if (drawable == null)
throw new InvalidOperationException($"A drawable representation could not be retrieved for hitobject type: {entry.HitObject.GetType().ReadableName()}.");
drawable.OnNewResult += onNewResult;
drawable.OnRevertResult += onRevertResult;