Skip to content

Commit

Permalink
fix(github): check vulnerability alerts return values
Browse files Browse the repository at this point in the history
Closes #6067
  • Loading branch information
rarkins committed Apr 28, 2020
1 parent d63c92a commit 993f411
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/platform/github/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1899,7 +1899,7 @@ export async function getVulnerabilityAlerts(): Promise<VulnerabilityAlert[]> {
let alerts = [];
try {
const res = JSON.parse((await api.post(url, options)).body);
if (res.data.repository.vulnerabilityAlerts) {
if (res?.data?.repository?.vulnerabilityAlerts) {
alerts = res.data.repository.vulnerabilityAlerts.edges.map(
(edge: { node: any }) => edge.node
);
Expand Down

0 comments on commit 993f411

Please sign in to comment.