From 18b309a195e9aea1890a726dc1c77ed1f2e7afdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Sat, 23 Jan 2021 16:02:51 +0100 Subject: [PATCH] Make disposal of tracker operation idempotent --- osu.Game/Screens/OnlinePlay/OngoingOperationTracker.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/osu.Game/Screens/OnlinePlay/OngoingOperationTracker.cs b/osu.Game/Screens/OnlinePlay/OngoingOperationTracker.cs index 5c9e9ce90b..b834d4fa25 100644 --- a/osu.Game/Screens/OnlinePlay/OngoingOperationTracker.cs +++ b/osu.Game/Screens/OnlinePlay/OngoingOperationTracker.cs @@ -49,10 +49,7 @@ namespace osu.Game.Screens.OnlinePlay private void endOperation() { - if (leasedInProgress == null) - throw new InvalidOperationException("Cannot end operation multiple times."); - - leasedInProgress.Return(); + leasedInProgress?.Return(); leasedInProgress = null; } }