1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-26 15:50:29 +08:00

Exception instead of assert

This commit is contained in:
Dean Herbert
2020-04-13 21:24:47 +09:00
Unverified
parent c96df97586
commit 1c8a71b284
+2 -3
View File
@@ -2,7 +2,6 @@
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Diagnostics;
using Newtonsoft.Json;
using osu.Framework.IO.Network;
using osu.Framework.Logging;
@@ -32,8 +31,8 @@ namespace osu.Game.Online.API
internal void TriggerSuccess(T result)
{
// disallow calling twice
Debug.Assert(Result == null);
if (Result != null)
throw new InvalidOperationException("Attempted to trigger success more than once");
Result = result;
Success?.Invoke(result);