Skip to content

Commit e1b6307

Browse files
committed
add nil check
1 parent ce05f6a commit e1b6307

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

apisix/upstream.lua

+3-1
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,9 @@ function _M.set_by_route(route, api_ctx)
327327

328328
local nodes_count = up_conf.nodes and #up_conf.nodes or 0
329329
if nodes_count == 0 then
330-
release_checker(up_conf.parent)
330+
if up_conf.parent and up_conf.parent.checker then
331+
release_checker(up_conf.parent)
332+
end
331333
return HTTP_CODE_UPSTREAM_UNAVAILABLE, "no valid upstream node"
332334
end
333335

0 commit comments

Comments
 (0)