From 194992936d92a9e6765630a610603cf86608fdfd Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 23 Apr 2018 17:57:32 +0900 Subject: [PATCH] Use exceptions --- .../Edit/Screens/Compose/Layers/MaskContainer.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/osu.Game/Screens/Edit/Screens/Compose/Layers/MaskContainer.cs b/osu.Game/Screens/Edit/Screens/Compose/Layers/MaskContainer.cs index 7caece2b3e..993594f1d2 100644 --- a/osu.Game/Screens/Edit/Screens/Compose/Layers/MaskContainer.cs +++ b/osu.Game/Screens/Edit/Screens/Compose/Layers/MaskContainer.cs @@ -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 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Layers 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 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Layers 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);