make optional plugin configuration truly optional

This commit is contained in:
AJ ONeal 2019-04-05 20:08:20 -06:00
parent ca219a00e4
commit 90f65a1a63
1 changed files with 2 additions and 2 deletions

View File

@ -298,7 +298,7 @@ Greenlock.create = function (gl) {
gl.store = promisifyAllSelf(gl.store); gl.store = promisifyAllSelf(gl.store);
gl.store.accounts = promisifyAllStore(gl.store.accounts); gl.store.accounts = promisifyAllStore(gl.store.accounts);
gl.store.certificates = promisifyAllStore(gl.store.certificates); 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) { } catch(e) {
console.error(e); console.error(e);
console.error("\nPROBABLE CAUSE:\n" console.error("\nPROBABLE CAUSE:\n"
@ -329,7 +329,7 @@ Greenlock.create = function (gl) {
challenger = gl.challenges[challengeType] = challenger.create(gl); challenger = gl.challenges[challengeType] = challenger.create(gl);
} }
challenger = gl.challenges[challengeType] = promisifyAllSelf(challenger); 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) { Object.keys(gl['_challengeOpts_' + challengeType]).forEach(function (key) {
if (!(key in gl)) { if (!(key in gl)) {
gl[key] = gl['_challengeOpts_' + challengeType][key]; gl[key] = gl['_challengeOpts_' + challengeType][key];