From 2f6bbd155fcf6ce0d5298e93942bdbdcb1567e13 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sat, 16 Jan 2021 11:00:30 -0600 Subject: [PATCH] add natt suggestion of a try/catch attempts to load tasproj greenzone, puts a big ol piece of duct tape on the real problem but at least users can continue to use their file, fixes #2479 about as well as we can since we have no info as to how the greenzone got corrupted in the first place --- .../movie/tasproj/TasMovie.IO.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/BizHawk.Client.Common/movie/tasproj/TasMovie.IO.cs b/src/BizHawk.Client.Common/movie/tasproj/TasMovie.IO.cs index 613cadba58..d27ca4ae40 100644 --- a/src/BizHawk.Client.Common/movie/tasproj/TasMovie.IO.cs +++ b/src/BizHawk.Client.Common/movie/tasproj/TasMovie.IO.cs @@ -167,8 +167,17 @@ namespace BizHawk.Client.Common bl.GetLump(BinaryStateLump.StateHistory, false, delegate(BinaryReader br, long length) { - TasStateManager?.Dispose(); - TasStateManager = ZwinderStateManager.Create(br, settings, IsReserved); + try + { + TasStateManager?.Dispose(); + TasStateManager = ZwinderStateManager.Create(br, settings, IsReserved); + } + catch + { + // Do nothing, if state history got corrupted, the file is still very much useable + // and we would want the user to be able to load, and regenerate their state history + // however, we still have an issue of how state history got corrupted + } }); } }