Commit aa8ccf96 authored by Jan Reimes's avatar Jan Reimes
Browse files

fix: handle None payload in _strip_code_fences to prevent AttributeError

Fixes 'NoneType' object has no attribute 'strip' error when LLM returns
empty or null response. This prevents pipeline failures during summarization.
parent d029ae58
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -160,8 +160,10 @@ def _should_skip_summary(
        return False


def _strip_code_fences(payload: str) -> str:
def _strip_code_fences(payload: str | None) -> str:
    """Strip optional markdown code fences from LLM payloads."""
    if payload is None:
        return ""
    value = payload.strip()
    if value.startswith("```"):
        value = re.sub(r"^```(?:json)?\s*", "", value)