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

Fix crash if SpecialFolder.ApplicationData doesn't exist #143

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

agocke
Copy link

@agocke agocke commented Sep 21, 2023

If the folder doesn't exist, the config variable will be 'ILSpy.xml', and the parent directory name will be an empty string. This will cause CreateDirectory to throw, and the application to potentially crash due to an exception in a background thread. This manifests as a native crash, NSInternalInconsistencyException, on my machine, with the message 'Terminating app due to uncaught exception
'NSInternalInconsistencyException',reason: 'NSWindow drag regions should only be invalidated on the Main Thread'.

By passing 'DoNotVerify' to Environment.GetFolderPath we can avoid the check for directory existence and avoid the crash.

If the folder doesn't exist, the config variable will be 'ILSpy.xml',
and the parent directory name will be an empty string. This will cause
CreateDirectory to throw, and the application to potentially crash due
to an exception in a background thread. This manifests as a native
crash, NSInternalInconsistencyException, on my machine, with the message
'Terminating app due to uncaught exception
'NSInternalInconsistencyException',reason: 'NSWindow drag regions should
only be invalidated on the Main Thread'.

By passing 'DoNotVerify' to Environment.GetFolderPath we can avoid the
check for directory existence and avoid the crash.
@agocke
Copy link
Author

agocke commented Sep 21, 2023

VSCode removed all trailing whitespace here as well -- you can ignore that if you want.

@agocke
Copy link
Author

agocke commented Sep 21, 2023

Fixes #117

@agocke
Copy link
Author

agocke commented Sep 28, 2023

fyi @christophwille

@christophwille
Copy link
Member

To be honest, I have a hard time connecting the crash with that fix, and I have no way to verify it either. So I will punt on merging this until this repository has a maintainer again.

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