From b034d16c23beb59c4d9ef222b0844b0e8f7ea0b0 Mon Sep 17 00:00:00 2001 From: mrT23 Date: Mon, 19 Aug 2024 14:18:45 +0300 Subject: [PATCH] Add validation checks for 'latest_comment' and 'pr_url' in GitHub polling server --- pr_agent/servers/github_polling.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pr_agent/servers/github_polling.py b/pr_agent/servers/github_polling.py index 627390c0..c7bb5bff 100644 --- a/pr_agent/servers/github_polling.py +++ b/pr_agent/servers/github_polling.py @@ -80,6 +80,8 @@ async def polling_loop(): if 'subject' in notification and notification['subject']['type'] == 'PullRequest': pr_url = notification['subject']['url'] latest_comment = notification['subject']['latest_comment_url'] + if not isinstance(latest_comment, str) or not latest_comment or not pr_url: + continue async with session.get(latest_comment, headers=headers) as comment_response: if comment_response.status == 200: comment = await comment_response.json()