Skip to content

Commit

Permalink
fix: handle correctly when body is empty (#529)
Browse files Browse the repository at this point in the history
GitHub randomly returns None or ""

Depends-On: #520
  • Loading branch information
sileht authored Oct 29, 2024
1 parent 6c7f6a6 commit a61301e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions mergify_cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,11 +453,13 @@ async def create_or_update_stack( # noqa: PLR0913,PLR0917
"base": change.base_branch,
}
if keep_pull_request_title_and_body:
if change.pull["body"] is None:
msg = "GitHub returned a pull request without body set"
raise RuntimeError(msg)
pull_changes.update(
{"body": format_pull_description(change.pull["body"], depends_on)},
{
"body": format_pull_description(
change.pull["body"] or "",
depends_on,
),
},
)
else:
pull_changes.update(
Expand Down

0 comments on commit a61301e

Please sign in to comment.