Skip to content

Commit

Permalink
check condition presence
Browse files Browse the repository at this point in the history
  • Loading branch information
XVincentX committed Mar 16, 2019
1 parent 56d3262 commit 2c67b72
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/gateway/pipelines.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,12 @@ function configurePipeline(pipelinePoliciesConfig, config) {
const middlewares = policySteps.map(policyStep => {
const conditionConfig = policyStep.condition;

const condition = conditions[conditionConfig.name](conditionConfig);
let condition;

if (conditionConfig) {
condition = conditions[conditionConfig.name](conditionConfig);
}

const action = Object.assign({}, policyStep.action, ActionParams.prototype);
const policyMiddleware = policy(action, config);

Expand Down

0 comments on commit 2c67b72

Please sign in to comment.