Skip to content

Commit 5c0b76c

Browse files
authored
check if proto_obj.name exists before accessing it
1 parent cfa9f44 commit 5c0b76c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

apisix/plugins/grpc-transcode/response.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ local function fetch_proto_array_names(proto_obj)
4444
end
4545
end
4646
if proto_obj["label"] == repeated_label then
47-
names[proto_obj["name"]] = 1
47+
if proto_obj["name"] then
48+
names[proto_obj["name"]] = 1
49+
end
4850
end
4951
end
5052
return names

0 commit comments

Comments
 (0)