diff options
Diffstat (limited to 'lib/prompts.js')
-rw-r--r-- | lib/prompts.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/prompts.js b/lib/prompts.js index 779ef8d..bf37818 100644 --- a/lib/prompts.js +++ b/lib/prompts.js @@ -36,7 +36,7 @@ exports.prompt = function prompt(prompt, defaultValue) { if (result) { return stringValue.value; } else { - return undefined; + return null; } }; @@ -65,7 +65,7 @@ exports.promptPassword = function promptPassword(prompt) { if (result) { return password.value ? password.value : null; } else { - return undefined; + return null; } }; @@ -75,8 +75,7 @@ exports.promptPassword = function promptPassword(prompt) { */ exports.promptYesNoCancel = function promptOKNoCancel(prompt) { if (!prompt) { // either undefined or null - console.error("Prompt is required!"); - return undefined; + throw new Error("Prompt is required!"); } var prompts = Cc["@mozilla.org/embedcomp/prompt-service;1"] .getService(Ci.nsIPromptService); |