From dada2a4834f84f9008ce24fb57db385667ef67a0 Mon Sep 17 00:00:00 2001 From: Taicanium Date: Mon, 11 Mar 2024 16:27:47 -0500 Subject: [PATCH] Hotfix for a null reference error during single-file translation --- MessagePool.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/MessagePool.cs b/MessagePool.cs index 3eaa6b8..189a608 100644 --- a/MessagePool.cs +++ b/MessagePool.cs @@ -443,7 +443,10 @@ private static bool TranslateMessage(FileStream srcFS, StreamWriter dstFS) } string newDir = Path.Combine(Path.GetDirectoryName(destFile) ?? "C:", Path.GetFileNameWithoutExtension(destFile) ?? "UNKNOWN"); - writtenDirectories.Add(newDir); + + if (writtenDirectories is not null) + writtenDirectories.Add(newDir); + if (!Directory.Exists(newDir)) Directory.CreateDirectory(newDir); @@ -485,7 +488,7 @@ private static bool TranslateMessage(FileStream srcFS, StreamWriter dstFS) if (!Common.plaintext) { - messageData.Add( "