Skip to content

Commit

Permalink
fix: handle dependencies empty on sec release blog (#828)
Browse files Browse the repository at this point in the history
  • Loading branch information
RafaelGSS authored Jul 3, 2024
1 parent 2542268 commit 987aaca
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/security_blog.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,10 @@ export default class SecurityBlog {
}

getDependencyUpdatesTemplate(dependencyUpdates) {
if (!dependencyUpdates) return '';
let template = 'This security release includes the following dependency' +
' updates to address public vulnerabilities:\n\n';
if (typeof dependencyUpdates !== 'object') return '';
if (Object.keys(dependencyUpdates).length === 0) return '';
let template = '\nThis security release includes the following dependency' +
' updates to address public vulnerabilities:\n';
for (const dependencyUpdate of Object.values(dependencyUpdates)) {
for (const dependency of dependencyUpdate) {
const title = dependency.title.substring(dependency.title.indexOf(':') + ':'.length).trim();
Expand Down

0 comments on commit 987aaca

Please sign in to comment.