Skip to content

Commit

Permalink
Improve robustness of sender_id extraction in Bitbucket app server by…
Browse files Browse the repository at this point in the history
… using safe dictionary access
  • Loading branch information
mrT23 committed Nov 14, 2024
1 parent 2c3aa7b commit fe27f96
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pr_agent/servers/bitbucket_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ async def inner():
username = actor["nickname"]
log_context["sender"] = username

sender_id = data["data"]["actor"]["account_id"]
sender_id = data.get("data", {}).get("actor", {}).get("account_id", "")
log_context["sender_id"] = sender_id
jwt_parts = input_jwt.split(".")
claim_part = jwt_parts[1]
Expand Down

0 comments on commit fe27f96

Please sign in to comment.