Use exceptions

This commit is contained in:
Dean Herbert 2018-04-23 17:57:32 +09:00
parent 0709a0926b
commit 194992936d
1 changed files with 4 additions and 6 deletions

View File

@ -3,8 +3,8 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using JetBrains.Annotations;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Input;
@ -44,8 +44,7 @@ public MaskContainer()
public override void Add(HitObjectMask drawable)
{
// Rider 2018.1 requires this (roslyn analyser issue?)
Debug.Assert(drawable != null);
if (drawable == null) throw new ArgumentNullException(nameof(drawable));
base.Add(drawable);
@ -55,10 +54,9 @@ public override void Add(HitObjectMask drawable)
drawable.DragRequested += onDragRequested;
}
public override bool Remove(HitObjectMask drawable)
public override bool Remove([NotNull] HitObjectMask drawable)
{
// Rider 2018.1 requires this (roslyn analyser issue?)
Debug.Assert(drawable != null);
if (drawable == null) throw new ArgumentNullException(nameof(drawable));
var result = base.Remove(drawable);