Skip to content

Commit

Permalink
fix PR
Browse files Browse the repository at this point in the history
  • Loading branch information
kingluo committed May 10, 2023
1 parent 2fbbd22 commit 66bd5bc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions apisix/core/config_etcd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,10 @@ local function run_watch(premature)
local rev = 0
if loaded_configuration then
local _, res = next(loaded_configuration)
rev = tonumber(res.headers["X-Etcd-Index"])
assert(rev > 0, 'invalid res.headers["X-Etcd-Index"]')
if res then
rev = tonumber(res.headers["X-Etcd-Index"])
assert(rev > 0, 'invalid res.headers["X-Etcd-Index"]')
end
end

if rev == 0 then
Expand Down

0 comments on commit 66bd5bc

Please sign in to comment.