From c86cbd5edf70e09be234954cbf55f49cc1eb5976 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Tue, 9 Aug 2016 19:28:47 -0600 Subject: [PATCH] fix #1 return null when keypath cannot be derived --- index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.js b/index.js index 5785372..003473c 100644 --- a/index.js +++ b/index.js @@ -144,6 +144,9 @@ module.exports.create = function (configs) { , keypairs: { checkAsync: function (keypath, format) { + if (!keypath) { + return null; + } return fs.readFileAsync(keypath, 'ascii').then(function (key) { if ('jwk' === format) { return { privateKeyJwk: JSON.parse(key) };