Fix exception in alert for inavlid parameter
This commit is contained in:
parent
b0f3443d72
commit
18a38dbfc1
1 changed files with 4 additions and 13 deletions
|
@ -154,20 +154,11 @@ window.open = function (url, frameName, features) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use the dialog API to implement alert().
|
// Use the dialog API to implement alert().
|
||||||
window.alert = function (message, title) {
|
window.alert = function (message = '', title = '') {
|
||||||
var buttons
|
|
||||||
if (arguments.length === 0) {
|
|
||||||
message = ''
|
|
||||||
}
|
|
||||||
if (title == null) {
|
|
||||||
title = ''
|
|
||||||
}
|
|
||||||
buttons = ['OK']
|
|
||||||
message = String(message)
|
|
||||||
remote.dialog.showMessageBox(remote.getCurrentWindow(), {
|
remote.dialog.showMessageBox(remote.getCurrentWindow(), {
|
||||||
message: message,
|
message: String(message),
|
||||||
title: title,
|
title: String(title),
|
||||||
buttons: buttons
|
buttons: ['OK']
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue