Skip to content

Commit

Permalink
chore: fix undefined ref
Browse files Browse the repository at this point in the history
  • Loading branch information
lwhiteley committed Oct 21, 2021
1 parent b5c04e6 commit 5d0057d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const getUsernames = ({ payload }) => {
return users;
};

const buildTag = ({ issueNumber, status, title, url }) => {
const buildTag = ({ issueNumber, status, title, url } = {}) => {
return [SEARCH_PREFIX, issueNumber, status, `<${url}|${title}>`].join(DELIM);
};

Expand Down Expand Up @@ -252,8 +252,9 @@ const getWatchers = (match) => {

if (match && Array.isArray(match.attachments)) {
const { fields } =
match.attachments.find(({ title }) => title.includes(WATCHERS_TITLE)) ||
{};
match.attachments.filter(Boolean).find((data = {}) => {
return get(data, 'title').includes(WATCHERS_TITLE);
}) || {};
if (fields) {
watchers = `\n${fields[0].value}`;
}
Expand Down

0 comments on commit 5d0057d

Please sign in to comment.