Skip to content

Commit 271c432

Browse files
author
georgeji
committed
fix panic when meta is null
1 parent 19623d7 commit 271c432

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

apisix/discovery/consul/init.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,9 @@ function _M.connect(premature, consul_server, retry_delay)
517517
end
518518

519519
local svc_address, svc_port, metadata = service.Address, service.Port, service.Meta
520+
if type(metadata) ~= "table" then
521+
metadata = nil
522+
end
520523
-- Handle nil or 0 port case - default to 80 for HTTP services
521524
if not svc_port or svc_port == 0 then
522525
svc_port = 80

0 commit comments

Comments
 (0)