From d0970c5ba4935e67e41ca485d559966992adbe95 Mon Sep 17 00:00:00 2001 From: adelikat Date: Thu, 2 Oct 2014 23:19:37 +0000 Subject: [PATCH] fix last commit --- .../movie/tasproj/TasStateManager.cs | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/BizHawk.Client.Common/movie/tasproj/TasStateManager.cs b/BizHawk.Client.Common/movie/tasproj/TasStateManager.cs index 17b3742dc9..55bede9e8e 100644 --- a/BizHawk.Client.Common/movie/tasproj/TasStateManager.cs +++ b/BizHawk.Client.Common/movie/tasproj/TasStateManager.cs @@ -138,15 +138,21 @@ namespace BizHawk.Client.Common /// public void Clear() { - var power = States.FirstOrDefault(s => s.Key == 0); - States.Clear(); - - if (power.Value.Length > 0) + if (States.Any()) { - States.Add(0, power.Value); - } + var power = States.FirstOrDefault(s => s.Key == 0); + States.Clear(); - Used = power.Value.Length; + if (power.Value.Length > 0) + { + States.Add(0, power.Value); + Used = power.Value.Length; + } + else + { + Used = 0; + } + } } public void Save(BinaryWriter bw)