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: potential exception when calling webFrameMainBinding.fromIdOrNull() #35785

Merged
merged 2 commits into from Sep 24, 2022

Conversation

miniak
Copy link
Contributor

@miniak miniak commented Sep 23, 2022

Description of Change

TypeError: Error processing argument at index 1, conversion failure from undefined

happens here in the generated out/release/gen/electron/js2c/browser_init.js

this.on("-ipc-message",(function(e,r,n,s){if(addSenderFrameToEvent(e),r)c.ipcMainInternal.emit(n,e,...s);else{addReplyToEvent(e),this.emit("ipc-message",e,n,...s);const r=p.fromIdOrNull(e.processId,e.frameId);r&&r.ipc.emit(n,e,...s),t.emit(n,e,...s),o.ipcMain.emit(n,e,...s)}}))

which maps to

const maybeWebFrame = webFrameMainBinding.fromIdOrNull(event.processId, event.frameId);

Related to #35231

Checklist

  • PR description included and stakeholders cc'd
  • npm test passes

Release Notes

Notes: none

@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Sep 23, 2022
@miniak miniak force-pushed the miniak/fix-potential-emit-exception branch from bbdaaa9 to b9bd74d Compare September 23, 2022 12:51
@miniak miniak force-pushed the miniak/fix-potential-emit-exception branch from b9bd74d to e24d0fd Compare September 23, 2022 13:38
@miniak miniak self-assigned this Sep 23, 2022
@miniak miniak added semver/patch backwards-compatible bug fixes no-backport labels Sep 23, 2022
@miniak miniak added target/21-x-y PR should also be added to the "21-x-y" branch. and removed no-backport labels Sep 23, 2022
@miniak miniak force-pushed the miniak/fix-potential-emit-exception branch from 7a67b91 to df8d8be Compare September 23, 2022 21:13
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Sep 24, 2022
@VerteDinde VerteDinde merged commit f62aab7 into main Sep 24, 2022
@VerteDinde VerteDinde deleted the miniak/fix-potential-emit-exception branch September 24, 2022 19:19
@release-clerk
Copy link

release-clerk bot commented Sep 24, 2022

No Release Notes

@trop
Copy link
Contributor

trop bot commented Sep 24, 2022

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

@trop trop bot added in-flight/21-x-y merged/21-x-y PR was merged to the "21-x-y" branch. and removed target/21-x-y PR should also be added to the "21-x-y" branch. in-flight/21-x-y labels Sep 24, 2022
khalwa pushed a commit to solarwindscloud/electron that referenced this pull request Feb 22, 2023
…l() (electron#35785)

* fix: potential exception when calling webFrameMainBinding.fromIdOrNull()

* replace try/catch in getWebFrameForEvent

Co-authored-by: Milan Burda <miburda@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged/21-x-y PR was merged to the "21-x-y" branch. semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants