-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Fix crash when canceling file picker in profile settings #19504
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
base: main
Are you sure you want to change the base?
Fix crash when canceling file picker in profile settings #19504
Conversation
Wraps SetClientGuid, SetFileTypes, and related dialog setup calls in try-catch blocks to prevent unhandled exceptions when the user cancels the file selection dialog or when dialog configuration fails. Previously, if these operations threw an exception (which could happen during cancellation or in certain system states), it would crash the terminal. Now these operations are treated as non-fatal, allowing the dialog to still open even if some configuration steps fail. Fixes microsoft#19501
|
@microsoft-github-policy-service agree
@microsoft-github-policy-service agree |
Wraps SetClientGuid, SetFileTypes, and related dialog setup calls in try-catch blocks to prevent unhandled exceptions when the user cancels the file selection dialog or when dialog configuration fails.
Previously, if these operations threw an exception (which could happen during cancellation or in certain system states), it would crash the terminal. Now these operations are treated as non-fatal, allowing the dialog to still open even if some configuration steps fail.
Fixes #19501
Fix crash when canceling file picker in profile settings
Summary
Fixes a crash that occurs when users cancel the file selection dialog while setting the Command Line executable or Starting Directory for a profile.
References
Closes #19501
Detailed Description
When adding a new profile and clicking the browse button to select a Command Line executable or Starting Directory, canceling the file dialog would cause the terminal to crash. This happened because some of the file dialog configuration calls could throw exceptions that weren't being caught.
Changes Made
Added proper exception handling to the
Commandline_ClickandStartingDirectory_Clickfunctions:SetClientGuid,SetFileTypes, and related calls in try-catch blocksSetDefaultFolderelsewhere in the codebaseValidation
PR Checklist