prevent exception when ProgramFiles env is not set

This probably only occurs in non-Windows environments (Wine).
This commit is contained in:
Jakob Gillich 2019-11-03 22:49:45 +01:00 committed by GitHub
parent a915df802e
commit 4461503856
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -126,8 +126,11 @@ namespace PSLauncher
pathsToCheck.Add(psFolder);
// worth a shot! (for windows XP or old installs)
psFolder = Path.Combine(ProgramFilesx86(), "Sony\\PlanetSide");
pathsToCheck.Add(psFolder);
string programFiles = ProgramFilesx86();
if(programFiles != null) {
psFolder = Path.Combine(programFiles, "Sony\\PlanetSide");
pathsToCheck.Add(psFolder);
}
int i = 1;
foreach(var path in pathsToCheck)