Skip to content

Commit

Permalink
Guard against empty framePath and title
Browse files Browse the repository at this point in the history
This happens sometimes when dragging out / combining tabs

This doesn't solve brave#10436 but it makes it less likely to happen because
of some randomly encountered js errors when detaching.

Auditors: @bsclifton
  • Loading branch information
bbondy authored and dfperry5 committed Aug 18, 2017
1 parent 5f5b30d commit 62bd435
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/browser/windows.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ const api = {
setTitle: (windowId, title) => {
setImmediate(() => {
const win = currentWindows[windowId]
if (win && !win.isDestroyed()) {
if (win && !win.isDestroyed() && title != null) {
win.setTitle(title)
}
})
Expand Down
13 changes: 8 additions & 5 deletions js/stores/windowStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -870,11 +870,14 @@ frameShortcuts.forEach((shortcut) => {
if (shortcut === 'toggle-dev-tools') {
appActions.toggleDevTools(frameStateUtil.getActiveFrameTabId(windowState))
} else {
windowState = windowState.mergeIn(frameStateUtil.activeFrameStatePath(windowState), {
activeShortcut: shortcut,
activeShortcutDetails: args
})
emitChanges()
const framePath = frameStateUtil.activeFrameStatePath(windowState)
if (framePath) {
windowState = windowState.mergeIn(framePath, {
activeShortcut: shortcut,
activeShortcutDetails: args
})
emitChanges()
}
}
})
// Listen for actions on frame N
Expand Down

0 comments on commit 62bd435

Please sign in to comment.