Skip to content

Commit 239e9d2

Browse files
jreakinCopilot
andauthored
Update src/toon_format/decoder.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 7f854b5 commit 239e9d2

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/toon_format/decoder.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,8 @@ def decode(input_str: str, options: Optional[DecodeOptions] = None) -> Union[Jso
329329

330330
# If json_indent is specified, return JSON-formatted string
331331
if options.json_indent is not None:
332+
if options.json_indent < 0:
333+
raise ValueError(f"json_indent must be non-negative, got {options.json_indent}")
332334
return json.dumps(result, indent=options.json_indent, ensure_ascii=False)
333335

334336
return result

0 commit comments

Comments
 (0)