Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Merge pull request #4891 from willy-b/issue-4883-2
Browse files Browse the repository at this point in the history
Fix Brave crashing on confirm bug
  • Loading branch information
bbondy authored Oct 19, 2016
2 parents 75c3880 + d1b5392 commit 3840430
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,11 +363,10 @@ app.on('ready', () => {
ipcMain.removeAllListeners('window-alert')
ipcMain.on('window-alert', function (event, message, title) {
var buttons
if (title == null) {
title = ''
}

buttons = ['OK']
message = message ? message.toString() : ''
title = title ? title.toString() : ''
dialog.showMessageBox(BrowserWindow.getFocusedWindow(), {
message: message,
title: title,
Expand All @@ -379,10 +378,10 @@ app.on('ready', () => {
ipcMain.removeAllListeners('window-confirm')
ipcMain.on('window-confirm', function (event, message, title) {
var buttons, cancelId
if (title == null) {
title = ''
}

buttons = ['OK', 'Cancel']
message = message ? message.toString() : ''
title = title ? title.toString() : ''
cancelId = 1
event.returnValue = !dialog.showMessageBox(BrowserWindow.getFocusedWindow(), {
message: message,
Expand Down

0 comments on commit 3840430

Please sign in to comment.