Skip to content
This repository was archived by the owner on Jun 3, 2026. It is now read-only.

Commit c2fc0aa

Browse files
committed
fix(scanner): tolerate null untrusted prompt fields
1 parent f5f76e7 commit c2fc0aa

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/scanner/enricher.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,12 @@
4545
_ESCAPED_CLOSE_TAG = r"<\/untrusted_code>"
4646

4747

48-
def _escape_untrusted(text: str) -> str:
48+
def _escape_untrusted(text: Any) -> str:
4949
"""Neutralise both tag forms so untrusted content cannot break the isolation block."""
50+
if text is None:
51+
text = ""
52+
else:
53+
text = str(text)
5054
return (
5155
text
5256
.replace(_UNTRUSTED_CLOSE_TAG, _ESCAPED_CLOSE_TAG)

0 commit comments

Comments
 (0)