From 447a384aeef9d320e6eb17ce1c596a7fea3cc812 Mon Sep 17 00:00:00 2001 From: Abhinav Kumar Date: Thu, 10 Jul 2025 18:17:31 +0530 Subject: [PATCH] fix: return empty string for None or empty PR title in cleaning method --- pr_agent/tools/pr_description.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pr_agent/tools/pr_description.py b/pr_agent/tools/pr_description.py index c0ba2b68..c0b7fa24 100644 --- a/pr_agent/tools/pr_description.py +++ b/pr_agent/tools/pr_description.py @@ -761,7 +761,9 @@ class PRDescription: @staticmethod def clean_title(title: str) -> str: - """Clean the PR title by normalizing all whitespace to a single space and stripping leading/trailing spaces.""" + """Clean the PR title by normalizing all whitespace to a single space and stripping leading/trailing spaces. Returns empty string if input is None or empty.""" + if not title: + return "" return re.sub(r'\s+', ' ', title.strip())