summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2018-04-05 22:34:43 +0200
committerRicardo Wurmus <rekado@elephly.net>2018-04-05 22:34:43 +0200
commit15164a6f4aae29e8c3df0d21b0ac1d585c286a07 (patch)
tree5f6147972fa9a07fd000a99e2e6b435af9d66941
parentb89b720d908acbb7f683f4a8b7815abfc7092ffb (diff)
Make pict-attr safe.
-rw-r--r--pict.scm5
1 files changed, 3 insertions, 2 deletions
diff --git a/pict.scm b/pict.scm
index 6c7bef6..bc33314 100644
--- a/pict.scm
+++ b/pict.scm
@@ -582,10 +582,11 @@ strings that are built from the list of attributes LST."
(define (pict-attr attr pict)
"Return the value of the selected ATTRIBUTE of the outermost element
-of the SVG of PICT."
+of the SVG of PICT or #F."
(and=> ((sxpath `(@ ,attr *any*))
(pict-sxml pict))
- car))
+ (lambda (m) (and (pair? m)
+ (car m)))))
(define (pict-height pict)
"Return the height of PICT."