Skip to content

Commit

Permalink
src/webhooks.py: Prevent possible KeyError in pull_request_edited web…
Browse files Browse the repository at this point in the history
…hook when fetching changes
  • Loading branch information
cbrxyz committed Sep 21, 2024
1 parent dafe0ad commit 227633e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/webhooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ async def pull_request_edited(self, payload: ClientPayload):
repo = f"[{gh['repository']['full_name']}]({self.url(gh['repository'], html=True)})"
title = f"\"{gh['pull_request']['title']}\""
updates_channel = self.updates_channel(gh["repository"])
if gh["changes"]["title"]:
if "title" in gh["changes"] and gh["changes"]["title"]:
await updates_channel.send(
f"{name} edited the title of pull request {pr} in {repo} to {title}",
)
Expand Down

0 comments on commit 227633e

Please sign in to comment.