Skip to content

Commit

Permalink
Fixed: No Launcher Folder when Null Launcher Path Value in Test
Browse files Browse the repository at this point in the history
  • Loading branch information
Sewer56 committed Feb 23, 2022
1 parent 09c8594 commit 2fc2193
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion source/Reloaded.Mod.Loader.IO/Config/LoaderConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,15 @@ private string GetLauncherFolder()
if (_launcherFolder != null)
return _launcherFolder;

// Get launcher path.
var launcherPath = LauncherPath;
if (string.IsNullOrEmpty(LauncherPath))
launcherPath = Paths.CurrentProgramFolder;

// Workaround for when non-launcher folder is used.
// e.g. When using loader.
var launcherFolder = NormalizePath(Paths.CurrentProgramFolder);
var launcherFolderFallback = NormalizePath(Path.GetDirectoryName(LauncherPath));
var launcherFolderFallback = NormalizePath(Path.GetDirectoryName(launcherPath));
if (!launcherFolder.Equals(launcherFolderFallback, StringComparison.OrdinalIgnoreCase))
launcherFolder = launcherFolderFallback;

Expand Down

0 comments on commit 2fc2193

Please sign in to comment.