1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 02:42:54 +08:00

Remove unnecessary permissiveness wrt null

This commit is contained in:
Bartłomiej Dach 2021-01-08 22:17:37 +01:00
parent edd328c8fe
commit dad5dd3667
2 changed files with 6 additions and 6 deletions

View File

@ -241,7 +241,8 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
void endOperation()
{
readyClickOperation?.Dispose();
Debug.Assert(readyClickOperation != null);
readyClickOperation.Dispose();
readyClickOperation = null;
}
}

View File

@ -40,13 +40,12 @@ namespace osu.Game.Screens.OnlinePlay
return new InvokeOnDisposal(endOperation);
}
/// <summary>
/// Ends tracking an online operation.
/// Does nothing if an operation has not been begun yet.
/// </summary>
private void endOperation()
{
leasedInProgress?.Return();
if (leasedInProgress == null)
throw new InvalidOperationException("Cannot end operation multiple times.");
leasedInProgress.Return();
leasedInProgress = null;
}
}