Skip to content

Commit

Permalink
fix: Close OAuth BrowserView only if present (#2313)
Browse files Browse the repository at this point in the history
It seems our OAuth `BrowserView` can be undefined when it's time to
close it.
Although we're uncertain why, it could be Electron closes it already
when loading the redirect URL.

Anyway, we can check for its presence before trying to close it and
avoid errors.
  • Loading branch information
taratatach authored Jul 26, 2023
1 parent 2682ac2 commit 110a5a6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gui/js/onboarding.window.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ module.exports = class OnboardingWM extends WindowManager {
}

closeOAuthView() {
this.win.removeBrowserView(this.oauthView)
if (this.oauthView) {
this.win.removeBrowserView(this.oauthView)
}
}

async create() {
Expand Down

0 comments on commit 110a5a6

Please sign in to comment.