fix: _derive_title crashes on non-string content instead of returning Untitled (#1751)

This commit is contained in:
Afonso Coutinho
2026-06-03 05:25:41 +01:00
committed by GitHub
parent 2625e97f11
commit a714915afe
2 changed files with 15 additions and 0 deletions
+2
View File
@@ -203,6 +203,8 @@ def _assert_pdf_marker_upload_owned(
def _derive_title(content: str) -> str:
"""Derive a title from document content."""
import re
if not isinstance(content, str):
return "Untitled"
text = content.strip()
if not text:
return "Untitled"