Skip to content

Commit

Permalink
Attempt at fixing crash from inserting pokémon with external jsons.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nifyr committed Dec 14, 2023
1 parent 5cc2f6c commit bd76078
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion FileManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,13 @@ private T GetExternalJson<T>(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()
Expand Down

0 comments on commit bd76078

Please sign in to comment.