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 when setWindowOpenHandler callback throws #34523

Merged
merged 2 commits into from Jun 14, 2022
Merged

Conversation

codebytere
Copy link
Member

Description of Change

Closes #34508.

Fixes an error where setWindowOpenHandler() would crash if the callback threw an error. Fix this issue by wrapping the call in a try/catch and handling appropriately if an error is thrown.

Checklist

Release Notes

Notes: Fixed an error where setWindowOpenHandler() would crash if the callback threw an error

@codebytere codebytere added semver/patch backwards-compatible bug fixes target/18-x-y labels Jun 13, 2022
@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Jun 13, 2022
@codebytere codebytere changed the title fix: crash when setWindowOpenHandler throws fix: crash when setWindowOpenHandler callback throws Jun 13, 2022
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Jun 14, 2022
@jkleinsc jkleinsc merged commit bed38e0 into main Jun 14, 2022
@jkleinsc jkleinsc deleted the fix-handler-throw branch June 14, 2022 16:22
@release-clerk
Copy link

release-clerk bot commented Jun 14, 2022

Release Notes Persisted

Fixed an error where setWindowOpenHandler() would crash if the callback threw an error

@trop
Copy link
Contributor

trop bot commented Jun 14, 2022

I was unable to backport this PR to "18-x-y" cleanly;
you will need to perform this backport manually.

@trop
Copy link
Contributor

trop bot commented Jun 14, 2022

I have automatically backported this PR to "19-x-y", please check out #34546

@trop
Copy link
Contributor

trop bot commented Jun 14, 2022

I have automatically backported this PR to "20-x-y", please check out #34547

@trop
Copy link
Contributor

trop bot commented Jun 19, 2022

@miniak has manually backported this PR to "18-x-y", please check out #34627

zcbenz pushed a commit that referenced this pull request Jun 20, 2022
fix: crash when `setWindowOpenHandler` callback throws (#34523)

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
@trop
Copy link
Contributor

trop bot commented Jun 28, 2022

@miniak has manually backported this PR to "17-x-y", please check out #34772

VerteDinde pushed a commit that referenced this pull request Jun 29, 2022
fix: crash when `setWindowOpenHandler` callback throws (#34523)
khalwa pushed a commit to solarwindscloud/electron that referenced this pull request Feb 22, 2023
* fix: crash when setWindowOpenHandler throws

* refactor: throw as process uncaughtException event
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Unhandled exception in webcontents.setWindowOpenHandler crashes application
5 participants