Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Fatal Exception on non-existent LastSelectedGamePath #14

Open
JustArion opened this issue Sep 30, 2023 · 0 comments
Open

[Bug] Fatal Exception on non-existent LastSelectedGamePath #14

JustArion opened this issue Sep 30, 2023 · 0 comments

Comments

@JustArion
Copy link

JustArion commented Sep 30, 2023

Stacktrace:

Application: MelonLoader.Installer.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.DirectoryNotFoundException
   at System.Windows.Forms.Control.MarshaledInvoke(System.Windows.Forms.Control, System.Delegate, System.Object[], Boolean)
   at System.Windows.Forms.Control.Invoke(System.Delegate, System.Object[])
   at System.Windows.Forms.Control.Invoke(System.Delegate)
   at MelonLoader.ThreadHandler.RefreshReleases()
   at MelonLoader.ThreadHandler.GetReleases()
   at MelonLoader.ThreadHandler.CheckForInstallerUpdate()
   at System.Threading.ThreadHelper.ThreadStart_Context(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Threading.ThreadHelper.ThreadStart()

The exception is likely thrown at MainForm.cs#L98 due to ThreadHandler.cs#L180

Solutions to this could be checking either File.Exists(Config.LastSelectedGamePath) after the string.IsNullOrEmpty check or a Directory.Exists(Path.GetDirectoryName(Config.LastSelectedGamePath))

The File.Exists being the likely best option since the game path includes the .exe.

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

No branches or pull requests

1 participant