Fix starts-with? crash: guard with string? check on attribute name

orchestration.sx process-elements iterates DOM attributes and calls
starts-with? on the name. Some attributes have nil names (e.g. from
malformed elements). Added (string? name) guard before starts-with?.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-18 07:33:05 +00:00
parent de90cd04f2
commit f78a97960f
3 changed files with 4 additions and 4 deletions

View File

@@ -1461,7 +1461,7 @@
(let
((name (first attr)) (body (nth attr 1)))
(when
(starts-with? name "sx-on:")
(and (string? name) (starts-with? name "sx-on:"))
(let
((event-name (let ((raw (slice name 6))) (if (or (starts-with? raw "after") (starts-with? raw "before")) (str "sx:" raw) raw))))
(when

File diff suppressed because one or more lines are too long

View File

@@ -1461,7 +1461,7 @@
(let
((name (first attr)) (body (nth attr 1)))
(when
(starts-with? name "sx-on:")
(and (string? name) (starts-with? name "sx-on:"))
(let
((event-name (let ((raw (slice name 6))) (if (or (starts-with? raw "after") (starts-with? raw "before")) (str "sx:" raw) raw))))
(when