Skip to content

Commit

Permalink
Add Neccesary parameter to resolveVulnAliases function
Browse files Browse the repository at this point in the history
common.resolveVulnALiases needs the vulnerability source and the aliases to deduplicate the list on the Aliases column,

In case before, the only parameter added to the function was "value" which do not include neither the source of the current
vulnerability or their aliases.

Thats why I am adding row.source and row.aliases to the function.

I discovered that the 'return' statement was located within the condition if(typeof value !== 'undefined'),
This created a problem because the function would not return anything for null values.
To fix this, I moved the 'return' outside of the condition.

Signed-off-by: Andres Tito <[email protected]>
  • Loading branch information
LaVibeX committed Mar 11, 2024
1 parent cd81eb7 commit c9a2d33
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/views/portfolio/vulnerabilities/VulnerabilityList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ export default {
field: 'aliases',
visible: false,
formatter(value, row, index) {
let label = '';
if (typeof value !== 'undefined') {
let label = '';
const aliases = common.resolveVulnAliases(value);
const aliases = common.resolveVulnAliases(row.source,row.aliases);
for (let i = 0; i < aliases.length; i++) {
let alias = aliases[i];
let url = xssFilters.uriInUnQuotedAttr(
Expand All @@ -102,8 +102,8 @@ export default {
)}</a>`;
if (i < aliases.length - 1) label += '<br/><br/>';
}
return label;
}
return label;
},
},
{
Expand Down

0 comments on commit c9a2d33

Please sign in to comment.