summary refs log tree commit diff
diff options
context:
space:
mode:
authorCyber <cyber.hf18@gmail.com>2025-12-05 21:53:08 +0100
committerGitHub <noreply@github.com>2025-12-05 21:53:08 +0100
commit710b9280dee8877c2c4239756ee1063cf76e417f (patch)
treebfc9b1b4f6b723cb87e3491506a18e5d4e70d99e
parentMerge pull request #1428 from CyberL1/fix/guild-folder-types-nullable (diff)
parentfix: check if `body` is not `null` (diff)
downloadserver-ts-710b9280dee8877c2c4239756ee1063cf76e417f.tar.xz
Merge pull request #1429 from CyberL1/fix/github-webhook-pr-body-empty
-rw-r--r--src/api/routes/webhooks/#webhook_id/#token/github.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/api/routes/webhooks/#webhook_id/#token/github.ts b/src/api/routes/webhooks/#webhook_id/#token/github.ts

index 419b8d23..256130b9 100644 --- a/src/api/routes/webhooks/#webhook_id/#token/github.ts +++ b/src/api/routes/webhooks/#webhook_id/#token/github.ts
@@ -168,7 +168,9 @@ const parseGitHubWebhook = (req: Request, res: Response, next: NextFunction) => ]; if (req.body.action === "opened") { - discordPayload.embeds[0].description = req.body.pull_request.body.length > 500 ? `${req.body.pull_request.body.slice(0, 497)}...` : req.body.pull_request.body; + if (req.body.pull_request.body != null) { + discordPayload.embeds[0].description = req.body.pull_request.body.length > 500 ? `${req.body.pull_request.body.slice(0, 497)}...` : req.body.pull_request.body; + } discordPayload.embeds[0].color = 38912; } break;