refactor: Validate all required parameters before proceeding

Co-authored-by: ofir-frd <85901822+ofir-frd@users.noreply.github.com>
This commit is contained in:
Benedict Lee
2025-04-10 19:59:34 +09:00
committed by GitHub
parent 6bf093a6a1
commit c5165d917b

View File

@ -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