From c2265c6561cdb5cd547b1f73ee9e85fc65cb3b19 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Sun, 10 Apr 2016 23:11:29 -0400 Subject: [PATCH] Prevent dialog.showErrorBox() throwing if wrong parameters (#274) If the function lacks a message or a title, the following error is thrown: Error: Could not call remote function ``. Check that the function signature is correct. Underlying error: Error processing argument at index 0, conversion failure from undefined Signed-off-by: Juan Cruz Viotti --- lib/src/dialog.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/src/dialog.js b/lib/src/dialog.js index 2015ced7..ff6923cf 100644 --- a/lib/src/dialog.js +++ b/lib/src/dialog.js @@ -82,6 +82,7 @@ exports.selectImage = function() { * dialog.showError(new Error('Foo Bar')); */ exports.showError = function(error) { - electron.dialog.showErrorBox(error.message, error.stack || ''); + error = error || {}; + electron.dialog.showErrorBox(error.message || 'An error ocurred!', error.stack || ''); throw error; };