mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-05 13:20:39 +08:00
Add validation checks for 'latest_comment' and 'pr_url' in GitHub polling server
This commit is contained in:
@ -80,6 +80,8 @@ async def polling_loop():
|
|||||||
if 'subject' in notification and notification['subject']['type'] == 'PullRequest':
|
if 'subject' in notification and notification['subject']['type'] == 'PullRequest':
|
||||||
pr_url = notification['subject']['url']
|
pr_url = notification['subject']['url']
|
||||||
latest_comment = notification['subject']['latest_comment_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:
|
async with session.get(latest_comment, headers=headers) as comment_response:
|
||||||
if comment_response.status == 200:
|
if comment_response.status == 200:
|
||||||
comment = await comment_response.json()
|
comment = await comment_response.json()
|
||||||
|
Reference in New Issue
Block a user