Skip to content

Commit

Permalink
Check for empty match on incident lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenyeargin committed Apr 4, 2024
1 parent cfd8ee2 commit b8dfaeb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/scripts/pagerduty.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ module.exports = function (robot) {
return;
}

if (!incident || !incident['incident']) {
logger.debug(incident);
msg.send('No matching incident found for `msg.match[3]`.');
return;
}

msg.send(formatIncident(incident['incident']));
});
});
Expand Down

0 comments on commit b8dfaeb

Please sign in to comment.