Skip to content

Commit

Permalink
Policy::Logging: Fix crash on invalid config.
Browse files Browse the repository at this point in the history
If the logging config is not correct,operations are not defined,the loop
will not work and it'll crash.

Fix 3scale#1165
Fix THREESCALE-4605

Signed-off-by: Eloy Coto <eloy.coto@gmail.com>
  • Loading branch information
eloycoto committed Feb 28, 2020
1 parent 3616bc4 commit e64de68
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gateway/src/apicast/policy/logging/logging.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function _M:load_condition(config)

ngx.log(ngx.DEBUG, 'Enabling extended log with conditions')
local operations = {}
for _, operation in ipairs(config.condition.operations) do
for _, operation in ipairs(config.condition.operations or {}) do
table.insert( operations,
Operation.new(
operation.match, operation.match_type,
Expand Down

0 comments on commit e64de68

Please sign in to comment.