Skip to content

Commit

Permalink
Merge pull request #1737 from akto-api-security/hotfix/adding_null_ch…
Browse files Browse the repository at this point in the history
…eck_for_references

fix: added null check for references and cwes in test report
  • Loading branch information
Ark2307 authored Nov 19, 2024
2 parents a8247de + 104accb commit e1f0260
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function Category({ index, issue, subCategoryMap }) {

{
issue.vulnerableTestingRunResults.map((vulnerableTestingRunResult, index) => {
return ( <Issue testResults={issue.testResults} vulnerableApi={vulnerableTestingRunResult} cwes={issue.cwe} references={issue.references} /> )
return ( <Issue testResults={issue.testResults} vulnerableApi={vulnerableTestingRunResult} cwes={(issue?.cwe || [])} references={(issue?.references || [])} /> )
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ const Issue = ({ vulnerableApi, references, cwes }) => {
<Text variant="headingSm">References</Text>
<List type="number">
{
references.map((reference) => {
references?.map((reference) => {
return (
<List.Item>
<Link target="_blank" url={reference}><Text color="subdued">{reference}</Text></Link>
Expand All @@ -142,7 +142,7 @@ const Issue = ({ vulnerableApi, references, cwes }) => {
<Text variant="headingSm">CWE</Text>
<HorizontalStack gap={2}>
{
cwes.map((cweItem) => {
cwes?.map((cweItem) => {
return (
<Box>
<Badge size="small">{cweItem}</Badge>
Expand Down

0 comments on commit e1f0260

Please sign in to comment.