From 7b6b2742f65ac1d2590357babc517b6cd9b69d04 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Tue, 27 Jun 2017 11:37:50 -0400 Subject: fix corrupted state exceptions not being logged by SMAPI --- release-notes.md | 1 + src/StardewModdingAPI/Program.cs | 3 +++ 2 files changed, 4 insertions(+) diff --git a/release-notes.md b/release-notes.md index c76623b0..281c602c 100644 --- a/release-notes.md +++ b/release-notes.md @@ -27,6 +27,7 @@ For modders: * Fixed `SemanticVersion` parsing some invalid versions into close approximations (like `1.apple` → `1.0-apple`). * Fixed `SemanticVersion` not treating hyphens as separators when comparing prerelease tags. _(While that was technically correct, it leads to unintuitive behaviour like sorting `-alpha-2` _after_ `-alpha-10`, even though `-alpha.2` sorts before `-alpha.10`.)_ +* Fixed corrupted state exceptions not being logged by SMAPI. ## 1.14 See [log](https://github.com/Pathoschild/SMAPI/compare/1.13...1.14). diff --git a/src/StardewModdingAPI/Program.cs b/src/StardewModdingAPI/Program.cs index f313a9ac..7b843748 100644 --- a/src/StardewModdingAPI/Program.cs +++ b/src/StardewModdingAPI/Program.cs @@ -4,6 +4,8 @@ using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; using System.Reflection; +using System.Runtime.ExceptionServices; +using System.Security; using System.Threading; #if SMAPI_FOR_WINDOWS using System.Management; @@ -115,6 +117,7 @@ namespace StardewModdingAPI } /// Launch SMAPI. + [HandleProcessCorruptedStateExceptions, SecurityCritical] // let try..catch handle corrupted state exceptions public void RunInteractively() { // initialise SMAPI -- cgit