]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
policy: fix incompatibility with default (nil) phase
authorMarek Vavruša <mvavrusa@cloudflare.com>
Tue, 19 Jun 2018 21:50:20 +0000 (14:50 -0700)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Wed, 28 Nov 2018 14:29:13 +0000 (15:29 +0100)
The `{ nil }` would otherwise get interpreted as an empty table.

modules/policy/policy.lua

index c8116b884d1342023208df7179151723736186a2..819c6e4ff2150b24acd761778280e20c9471121b 100644 (file)
@@ -635,7 +635,7 @@ function policy.add(rule, phase)
        -- End of compatibility shim
        local desc = {id=getruleid(), cb=rule, count=0}
        if type(phase) ~= 'table' then
-               phase = {phase}
+               phase = {phase or 'begin'}
        end
        -- Allow multiple phases for the same rule
        for _, p in ipairs(phase) do