From 1c95d7b4ff626d8f2b9837ed62f53baaab713813 Mon Sep 17 00:00:00 2001 From: "richard.thake" Date: Tue, 23 Aug 2016 22:28:44 +0100 Subject: [PATCH 1/2] Added missing logic to handle undefined le.challenge.get exceptions --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index dd6f0ec..8cc1b64 100644 --- a/index.js +++ b/index.js @@ -254,7 +254,7 @@ LE.create = function (le) { throw new Error("le.challenge.set receives the wrong number of arguments." + " You must define setChallenge as function (opts, domain, key, val, cb) { }"); } - if (4 !== le.challenge.get.length) { + if (4 !== le.challenge.get.length || le.challenge.get === undefined) { throw new Error("le.challenge.get receives the wrong number of arguments." + " You must define getChallenge as function (opts, domain, key, cb) { }"); } From bef3b8162c81fb7c6ccca135c1009ffe98b54cbb Mon Sep 17 00:00:00 2001 From: "richard.thake" Date: Tue, 30 Aug 2016 22:53:01 +0100 Subject: [PATCH 2/2] Amended evaluation logic for handling le.challenge values. --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 8cc1b64..0f13cf1 100644 --- a/index.js +++ b/index.js @@ -254,7 +254,7 @@ LE.create = function (le) { throw new Error("le.challenge.set receives the wrong number of arguments." + " You must define setChallenge as function (opts, domain, key, val, cb) { }"); } - if (4 !== le.challenge.get.length || le.challenge.get === undefined) { + if (le.challenge.get && 4 !== le.challenge.get.length) { throw new Error("le.challenge.get receives the wrong number of arguments." + " You must define getChallenge as function (opts, domain, key, cb) { }"); }