From b6d77586af35795fa9423b3a9591f82adc012a73 Mon Sep 17 00:00:00 2001 From: SuuperW Date: Fri, 15 Jan 2021 09:38:08 -0600 Subject: [PATCH] Do not attempt to remove what isn't there. (fixes: removing a marker before a state was reserved would throw an exception.) --- .../movie/tasproj/ZwinderStateManager.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/BizHawk.Client.Common/movie/tasproj/ZwinderStateManager.cs b/src/BizHawk.Client.Common/movie/tasproj/ZwinderStateManager.cs index 9d1d1bf777..105873c34f 100644 --- a/src/BizHawk.Client.Common/movie/tasproj/ZwinderStateManager.cs +++ b/src/BizHawk.Client.Common/movie/tasproj/ZwinderStateManager.cs @@ -268,8 +268,11 @@ namespace BizHawk.Client.Common throw new InvalidOperationException("Frame 0 can not be evicted."); } - _reserved.Remove(frame); - StateCache.Remove(frame); + if (_reserved.ContainsKey(frame)) + { + _reserved.Remove(frame); + StateCache.Remove(frame); + } } public void Capture(int frame, IStatable source, bool force = false)