From bd760787772e1eca5addc42782bef5d27a67193b Mon Sep 17 00:00:00 2001 From: Nifyr Date: Fri, 15 Dec 2023 00:33:35 +0100 Subject: [PATCH] =?UTF-8?q?Attempt=20at=20fixing=20crash=20from=20insertin?= =?UTF-8?q?g=20pok=C3=A9mon=20with=20external=20jsons.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FileManager.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/FileManager.cs b/FileManager.cs index 9e02a8b..f794d72 100644 --- a/FileManager.cs +++ b/FileManager.cs @@ -594,7 +594,13 @@ private T GetExternalJson(string gamePath) public void CommitExternalJson(string externalJsonPath) { - fileArchive[externalJsonGamePath + "\\" + externalJsonPath].fileSource = FileSource.App; + string gamePath = externalJsonGamePath + "\\" + externalJsonPath; + if (!fileArchive.ContainsKey(gamePath)) + fileArchive[gamePath] = new() + { + gamePath = gamePath + }; + fileArchive[gamePath].fileSource = FileSource.App; } public ModArgs TryGetModArgs()