Skip to content

Commit

Permalink
Fix Pancea throwing an error when uninstalling due to missing one of …
Browse files Browse the repository at this point in the history
…the two supported PC collections filepath.

also checking if a filepath is not null before using it in Path.Combine. (this method cannot be called if the path is null but just in case the button shows up somehow
  • Loading branch information
shananas committed Feb 10, 2025
1 parent 29998f6 commit 3d3e62b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions OpenKh.Tools.ModsManager/ViewModels/SetupWizardViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1129,8 +1129,14 @@ public SetupWizardViewModel()
File.Delete(Path.Combine(PanaceaDependenciesLocation, "libspeex-1.dll"));
File.Delete(Path.Combine(PanaceaDependenciesLocation, "libvorbis.dll"));
File.Delete(Path.Combine(PanaceaDependenciesLocation, "swresample-vgmstream-4.dll"));
File.Delete(Path.Combine(PcReleaseLocation, "panacea_settings.txt"));
File.Delete(Path.Combine(PcReleaseLocationKH3D, "panacea_settings.txt"));
if (GameCollection == 0 && PcReleaseLocation != null)
{
File.Delete(Path.Combine(PcReleaseLocation, "panacea_settings.txt"));
}
if (GameCollection == 1 && PcReleaseLocationKH3D != null)
{
File.Delete(Path.Combine(PcReleaseLocationKH3D, "panacea_settings.txt"));
}
}
OnPropertyChanged(nameof(IsLastPanaceaVersionInstalled));
OnPropertyChanged(nameof(PanaceaInstalledVisibility));
Expand Down Expand Up @@ -1587,15 +1593,15 @@ public SetupWizardViewModel()
{
if (GameCollection == 0)
{
if (File.Exists(Path.Combine(PcReleaseLocation, "steam_appid.txt")))
if (PcReleaseLocation != null && File.Exists(Path.Combine(PcReleaseLocation, "steam_appid.txt")))
{
File.Delete(Path.Combine(PcReleaseLocation, "steam_appid.txt"));
ConfigurationService.SteamAPITrick1525 = false;
}
}
else if (GameCollection == 1)
{
if (File.Exists(Path.Combine(PcReleaseLocationKH3D, "steam_appid.txt")))
if (PcReleaseLocationKH3D != null && File.Exists(Path.Combine(PcReleaseLocationKH3D, "steam_appid.txt")))
{
File.Delete(Path.Combine(PcReleaseLocationKH3D, "steam_appid.txt"));
ConfigurationService.SteamAPITrick28 = false;
Expand Down

0 comments on commit 3d3e62b

Please sign in to comment.