Skip to content

fix: crash on startup when working directory is root - #1840

Merged
lemming104 merged 1 commit into
Helion-Engine:devfrom
iedame:crash-working-directory-root
Oct 11, 2026
Merged

lemming104 merged 1 commit into
Helion-Engine:devfrom
iedame:crash-working-directory-root

Conversation

@iedame

@iedame iedame commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Steps to reproduce

cd /
/path/to/Helion

On macOS this also happens whenever Helion is launched from an .app bundle
Screenshot 2026-10-11 at 12 59 04 PM
(Finder/Launchpad), because the working directory is / in that case.

Result

System.ArgumentException: The value cannot be an empty string. (Parameter 'path')
   at System.ArgumentException.ThrowNullOrEmptyException(String, String) + 0x40
   at System.IO.Path.GetFullPath(String) + 0x4c
   at Helion.Util.PathsManager.StandardizePath(String path) + 0x10
   at System.Linq.Enumerable.SizeOptIListSelectIterator`2.MoveNext() + 0x90
   at System.Linq.Enumerable.DistinctIterator`1.MoveNext() + 0x64
   at System.Collections.Generic.List`1..ctor(IEnumerable`1) + 0x90
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1) + 0x30
   at Helion.Resources.Archives.Locator.FilesystemArchiveLocator..ctor(PathsManager, IConfig, IList`1) + 0x54
   at Helion.Client.Client.Run(CommandLineArgs commandLineArgs, PathsManager pathsManager) + 0xfc

Cause

PathsManager.StandardizePath does Path.GetFullPath(path).TrimEnd(Path.DirectorySeparatorChar)
For / this trims the whole string, so the launch folder becomes ""
GetArchiveFolders later passes it through StandardizePath again, and Path.GetFullPath("") throws

With this change Helion starts normally from / and from an app bundle.
Found while packaging Helion for nixpkgs (NixOS/nixpkgs#554503) and confirmed the crash is reproducible on both macOS and linux, works as expected after applying patch.

Screenshot 2026-10-11 at 12 58 51 PM

@lemming104
lemming104 merged commit de2be15 into Helion-Engine:dev Oct 11, 2026
1 check passed
@iedame
iedame deleted the crash-working-directory-root branch October 11, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants