Skip to content

Commit 06acfbd

Browse files
fix: login failures on window il2cpp builds
1 parent 6a4e655 commit 06acfbd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Packages/Passport/Runtime/Scripts/Private/Helpers/WindowsDeepLink.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,8 @@ private static string GetGameExecutablePath(string suffix)
275275
if (suffix == ".exe")
276276
{
277277
// Get the path of the currently running executable
278+
#if !ENABLE_IL2CPP
279+
// Process.MainModule is only supported in Mono builds, not in IL2CPP, and will cause a crash
278280
try
279281
{
280282
var process = System.Diagnostics.Process.GetCurrentProcess();
@@ -291,6 +293,7 @@ private static string GetGameExecutablePath(string suffix)
291293
{
292294
PassportLogger.Warn($"Process inaccessible: {ex.Message}. Using fallback method.");
293295
}
296+
#endif
294297

295298
// Fallback: Use command line args
296299
var args = System.Environment.GetCommandLineArgs();

0 commit comments

Comments
 (0)