Revolyssup commented on code in PR #9995:
URL: https://github.com/apache/apisix/pull/9995#discussion_r1300872530


##########
apisix/plugins/traffic-split.lua:
##########
@@ -200,7 +200,7 @@ local function new_rr_obj(weighted_upstreams)
     for i, upstream_obj in ipairs(weighted_upstreams) do
         if upstream_obj.upstream_id then
             server_list[upstream_obj.upstream_id] = upstream_obj.weight
-        elseif upstream_obj.upstream then
+        elseif upstream_obj.upstream and type(upstream_obj.upstream) == 
"table" then

Review Comment:
   @monkeyDluffy6017 Yes I agree with you but the user's bug wasn't 
reproducible and the data gets corrupted later on so adding this extra check 
just avoid that nil panic, and nothing else.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to