1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 23:52:57 +08:00

Merge pull request #6560 from peppy/dho-ho-not-null

Ensure DrawableHitObject's HitObject is not null
This commit is contained in:
Dan Balasescu 2019-10-21 18:42:17 +09:00 committed by GitHub
commit 8210759039
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -239,7 +239,7 @@ namespace osu.Game.Rulesets.Taiko.Tests
private class TestStrongNestedHit : DrawableStrongNestedHit
{
public TestStrongNestedHit(DrawableHitObject mainObject)
: base(null, mainObject)
: base(new StrongHitObject { StartTime = mainObject.HitObject.StartTime }, mainObject)
{
}

View File

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