Skip to content

Commit

Permalink
Fallback for missing body (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus authored Oct 7, 2022
1 parent 8fea44a commit c59736e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion services/bots/src/github-webhook/handlers/month_of_wth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ export class MonthOfWTH extends BaseWebhookHandler {
public allowedOrganizations = [Organization.HOME_ASSISTANT];

async handle(context: WebhookContext<PullRequestOpenedEvent>) {
for (const link of extractForumLinks((context.payload.pull_request as PullRequest).body)) {
for (const link of extractForumLinks(
(context.payload.pull_request as PullRequest).body || '',
)) {
try {
const linkData = await (await fetch(`${link}.json`)).json();
if (linkData.category_id === WTH_CATEGORY_ID) {
Expand Down

0 comments on commit c59736e

Please sign in to comment.