Fix alert()
authorOctoHuman <OctoHuman@users.noreply.github.com>
Sun, 20 Mar 2016 07:09:30 +0000 (02:09 -0500)
committerOctoHuman <OctoHuman@users.noreply.github.com>
Sun, 20 Mar 2016 07:09:30 +0000 (02:09 -0500)
lib/renderer/override.js

index 69295d1..3daea93 100644 (file)
@@ -161,11 +161,14 @@ window.open = function(url, frameName, features) {
 // Use the dialog API to implement alert().
 window.alert = function(message, title) {
   var buttons;
+  if (message === undefined) {
+    message = '';
+  }
   if (title == null) {
     title = '';
   }
   buttons = ['OK'];
-  message = message.toString();
+  message = String(message);
   remote.dialog.showMessageBox(remote.getCurrentWindow(), {
     message: message,
     title: title,