Ensure DrawableHitObject's HitObject is not null

This commit is contained in:
Dean Herbert
2019-10-21 17:56:39 +09:00
parent b5997f2231
commit 9f004186d5

View File

@ -5,6 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Reflection; using System.Reflection;
using JetBrains.Annotations;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Extensions.TypeExtensions; using osu.Framework.Extensions.TypeExtensions;
@ -89,9 +90,9 @@ namespace osu.Game.Rulesets.Objects.Drawables
public IBindable<ArmedState> State => state; public IBindable<ArmedState> State => state;
protected DrawableHitObject(HitObject hitObject) protected DrawableHitObject([NotNull] HitObject hitObject)
{ {
HitObject = hitObject; HitObject = hitObject ?? throw new ArgumentNullException(nameof(hitObject));
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]