[MM-36543] Check for webcontents before trying to load url in case tab was removed (#1633)

This commit is contained in:
Devin Binnie
2021-06-21 08:48:31 -04:00
committed by GitHub
parent 62a0d148ec
commit 422673a740

View File

@@ -110,7 +110,7 @@ export class MattermostView extends EventEmitter {
retry = (loadURL) => { retry = (loadURL) => {
return () => { return () => {
// window was closed while retrying // window was closed while retrying
if (!this.view) { if (!this.view || !this.view.webContents) {
return; return;
} }
const loading = this.view.webContents.loadURL(loadURL, {userAgent: composeUserAgent()}); const loading = this.view.webContents.loadURL(loadURL, {userAgent: composeUserAgent()});