Skip to content

Commit

Permalink
Fix crash when selecting a mod with a code enabled that doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
Sora-yx committed Apr 8, 2024
1 parent e8a65ad commit 12d6558
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion SA-Mod-Manager/UI/MainWindow.xaml.cs
Expand Up @@ -389,7 +389,12 @@ private void modChecked_Click(object sender, RoutedEventArgs e)
{
SAModInfo inf = value;
if (!string.IsNullOrEmpty(inf.Codes))
codes.AddRange(CodeList.Load(Path.Combine(Path.Combine(modDir, mod), inf.Codes)).Codes);
{
string codePath = Path.Combine(Path.Combine(modDir, mod), inf.Codes);
if (File.Exists(codePath))
codes.AddRange(CodeList.Load(codePath).Codes);
}

}
}

Expand Down

0 comments on commit 12d6558

Please sign in to comment.