Skip to content

Commit

Permalink
Do not try to update pinned tabs in a destroyed window
Browse files Browse the repository at this point in the history
  • Loading branch information
petemill authored and bsclifton committed Nov 13, 2017
1 parent 64ecf51 commit 5fdf389
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion app/browser/windows.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,12 @@ const siteMatchesTab = (site, tab) => {
}

const updatePinnedTabs = (win) => {
if (win.webContents.browserWindowOptions.disposition === 'new-popup') {
// don't continue if window won't need pinned tabs updated
if (
!win ||
win.isDestroyed() ||
win.webContents.browserWindowOptions.disposition === 'new-popup'
) {
return
}
const appStore = require('../../js/stores/appStore')
Expand Down
3 changes: 2 additions & 1 deletion test/unit/app/browser/windowsTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ describe('window API unit tests', function () {
browserWindowOptions: {
disposition: ''
}
}
},
isDestroyed: () => false
}

before(function () {
Expand Down

0 comments on commit 5fdf389

Please sign in to comment.