From 44615038568d711367c29668fd5503e366d32b05 Mon Sep 17 00:00:00 2001 From: Jakob Gillich Date: Sun, 3 Nov 2019 22:49:45 +0100 Subject: [PATCH] prevent exception when ProgramFiles env is not set This probably only occurs in non-Windows environments (Wine). --- PSLauncher/Util.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/PSLauncher/Util.cs b/PSLauncher/Util.cs index 3a0e9c1..2496b5b 100644 --- a/PSLauncher/Util.cs +++ b/PSLauncher/Util.cs @@ -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)