Skip to content

Commit

Permalink
Avoid invalid index access in get_service_node_metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
sorenlouv authored Feb 25, 2020
1 parent 45cd56d commit 20e95a0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ export async function getServiceNodeMetadata({
const response = await client.search(query);

return {
host: response.aggregations?.host.buckets[0].key || NOT_AVAILABLE_LABEL,
host: response.aggregations?.host.buckets[0]?.key || NOT_AVAILABLE_LABEL,
containerId:
response.aggregations?.containerId.buckets[0].key || NOT_AVAILABLE_LABEL
response.aggregations?.containerId.buckets[0]?.key || NOT_AVAILABLE_LABEL
};
}

0 comments on commit 20e95a0

Please sign in to comment.