From 2f97f7ce1df6e144813ad38fb67a379bdce86bb3 Mon Sep 17 00:00:00 2001 From: wixoa Date: Tue, 26 Dec 2023 15:53:07 -0500 Subject: [PATCH] Put a try/catch around savefile flushing on shutdown (#1569) --- OpenDreamRuntime/EntryPoint.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/OpenDreamRuntime/EntryPoint.cs b/OpenDreamRuntime/EntryPoint.cs index 7897528a8b..6f962e645e 100644 --- a/OpenDreamRuntime/EntryPoint.cs +++ b/OpenDreamRuntime/EntryPoint.cs @@ -73,7 +73,11 @@ public override void PostInit() { protected override void Dispose(bool disposing) { // Write every savefile to disk foreach (var savefile in DreamObjectSavefile.Savefiles.ToArray()) { //ToArray() to avoid modifying the collection while iterating over it - savefile.Close(); + try { + savefile.Close(); + } catch (Exception e) { + Logger.GetSawmill("opendream").Error($"Exception while flushing savefile '{savefile.Resource.ResourcePath}', data has been lost. {e}"); + } } _dreamManager.Shutdown();