mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-14 09:40:39 +08:00
fix: return empty string for None or empty PR title in cleaning method
This commit is contained in:
@ -761,7 +761,9 @@ class PRDescription:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def clean_title(title: str) -> str:
|
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())
|
return re.sub(r'\s+', ' ', title.strip())
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user