Skip to content

Commit cf491b3

Browse files
authored
Merge pull request #2572 from akto-api-security/hotfix/handling_empty_data_in_api_changes_table
fix: handle potential null values in API response for sensitive param…
2 parents 08103c3 + 97ce4d1 commit cf491b3

File tree

1 file changed

+3
-3
lines changed
  • apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/observe/api_collections/component

1 file changed

+3
-3
lines changed

apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/observe/api_collections/component/ApiChangesTable.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ function ApiChangesTable(props) {
6363
await api.loadRecentEndpoints(startTimeStamp, endTimeStamp, skip, limit, filters, filterOperators, queryValue).then(async(res)=> {
6464
const apiInfos = res.endpoints
6565
total = res.totalCount
66-
await api.fetchSensitiveParamsForEndpoints(apiInfos.map((x) => {return x.id.url})).then(allSensitiveFields => {
67-
const sensitiveParams = allSensitiveFields.data.endpoints
68-
const mappedData = transform.fillSensitiveParams(sensitiveParams, apiInfos.map((x)=> {return x.id}));
66+
await api.fetchSensitiveParamsForEndpoints(apiInfos.map((x) => {return x?.id?.url})).then(allSensitiveFields => {
67+
const sensitiveParams = allSensitiveFields?.data?.endpoints
68+
const mappedData = transform.fillSensitiveParams(sensitiveParams, apiInfos.map((x)=> {return x?.id}));
6969
const normalData = func.mergeApiInfoAndApiCollection(mappedData, apiInfos, apiCollectionMap,{});
7070
ret = transform.prettifyEndpointsData(normalData);
7171
})

0 commit comments

Comments
 (0)