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: BrowserWindow.fromWebContents() can return null #19983

Merged
merged 1 commit into from Sep 27, 2019
Merged

Conversation

miniak
Copy link
Contributor

@miniak miniak commented Aug 27, 2019

Description of Change

Make it consistent with BrowserView.fromWebContents():

BrowserView.fromWebContents = (webContents) => {
for (const view of BrowserView.getAllViews()) {
if (view.webContents.equal(webContents)) return view
}
return null
}

Checklist

Release Notes

Notes: Fixed BrowserWindow.fromWebContents() to return null when no window is found for consistency with other APIs.

@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Aug 27, 2019
@miniak miniak requested a review from codebytere August 27, 2019 15:42
@miniak miniak self-assigned this Aug 27, 2019
codebytere
codebytere previously approved these changes Aug 27, 2019
@codebytere codebytere dismissed their stale review August 27, 2019 17:46

meant to comment

Copy link
Member

@codebytere codebytere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to update some specs here?

@miniak miniak added the wip ⚒ label Aug 28, 2019
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Aug 28, 2019
@codebytere
Copy link
Member

@miniak:

Unhandled exception in main spec runner: electron/spec-main/api-browser-window-spec.ts(1307,14): error TS2531: Object is possibly 'null'.

Copy link
Contributor

@alexeykuzmin alexeykuzmin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 much better now

@alexeykuzmin
Copy link
Contributor

@miniak can you please rebase onto the latest master?

@miniak
Copy link
Contributor Author

miniak commented Sep 27, 2019

@alexeykuzmin done

@codebytere codebytere merged commit ead8f2b into master Sep 27, 2019
@release-clerk
Copy link

release-clerk bot commented Sep 27, 2019

Release Notes Persisted

Fixed BrowserWindow.fromWebContents() to return null when no window is found for consistency with other APIs.

@codebytere codebytere deleted the miniak/doc-fix branch September 27, 2019 11:08
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.

None yet

3 participants