From c5165d917bdf9fbb338816e65239cb83a1b174e1 Mon Sep 17 00:00:00 2001 From: Benedict Lee Date: Thu, 10 Apr 2025 19:59:34 +0900 Subject: [PATCH] refactor: Validate all required parameters before proceeding Co-authored-by: ofir-frd <85901822+ofir-frd@users.noreply.github.com> --- pr_agent/tools/pr_line_questions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pr_agent/tools/pr_line_questions.py b/pr_agent/tools/pr_line_questions.py index 0157a57b..a8f310d9 100644 --- a/pr_agent/tools/pr_line_questions.py +++ b/pr_agent/tools/pr_line_questions.py @@ -109,8 +109,8 @@ class PR_LineQuestions: file_path = get_settings().get('file_name', '') line_number = get_settings().get('line_end', '') - # return if no comment id or file path and line number - if not (comment_id or (file_path and line_number)): + # return if any required parameter is missing + if not all([comment_id, file_path, line_number]): return # initialize conversation history