From 90f65a1a633306734e4ba5895bca8ee85945f704 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 5 Apr 2019 20:08:20 -0600 Subject: [PATCH] make optional plugin configuration truly optional --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index c8d0acf..7f9eef8 100644 --- a/index.js +++ b/index.js @@ -298,7 +298,7 @@ Greenlock.create = function (gl) { gl.store = promisifyAllSelf(gl.store); gl.store.accounts = promisifyAllStore(gl.store.accounts); gl.store.certificates = promisifyAllStore(gl.store.certificates); - gl._storeOpts = gl.store.options || gl.store.getOptions(); + gl._storeOpts = gl.store.getOptions && gl.store.getOptions() || gl.store.options || {}; } catch(e) { console.error(e); console.error("\nPROBABLE CAUSE:\n" @@ -329,7 +329,7 @@ Greenlock.create = function (gl) { challenger = gl.challenges[challengeType] = challenger.create(gl); } challenger = gl.challenges[challengeType] = promisifyAllSelf(challenger); - gl['_challengeOpts_' + challengeType] = challenger.options || challenger.getOptions(); + gl['_challengeOpts_' + challengeType] = challenger.getOptions && challenger.getOptions() || challenger.options || {}; Object.keys(gl['_challengeOpts_' + challengeType]).forEach(function (key) { if (!(key in gl)) { gl[key] = gl['_challengeOpts_' + challengeType][key];