From 4fbb95a12e2c7f729629c9875ce95fe086eee7bb Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Fri, 8 Jul 2011 14:04:22 -0600 Subject: [PATCH] Guard against non-string data --- views.lisp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/views.lisp b/views.lisp index db6bba6..dde22fc 100644 --- a/views.lisp +++ b/views.lisp @@ -244,35 +244,37 @@ (defun ppfc-html-labels (label name type formatter cdata print-func) (vector-push-extend '(write-string "" s) print-func) - (vector-push-extend `(write-string ,label s) print-func) + (vector-push-extend `(when (stringp ,label) (write-string ,label s)) print-func) (vector-push-extend '(write-string " " s) print-func) (ppfc-html label name type formatter cdata print-func)) (defun ppfc-xhtml-labels (label tag name type formatter cdata print-func) (vector-push-extend '(write-string "" s) print-func) - (vector-push-extend `(write-string ,label s) print-func) + (vector-push-extend `(when (stringp ,label) (write-string ,label s)) print-func) (vector-push-extend '(write-string " " s) print-func) (ppfc-html tag name type formatter cdata print-func)) (defun ppfc-xml-labels (label tag name type formatter cdata print-func) (vector-push-extend '(write-string " " s) print-func) (ppfc-xml tag name type formatter cdata print-func)) (defun ppfc-html-link (name type formatter cdata nlink print-func) (declare (fixnum nlink)) (vector-push-extend '(write-char #\< s) print-func) - (vector-push-extend `(write-string (nth ,(+ nlink nlink) links) s) print-func) + (vector-push-extend `(when (stringp (nth ,(+ nlink nlink) links)) + (write-string (nth ,(+ nlink nlink) links) s)) print-func) (vector-push-extend '(write-char #\> s) print-func) (vector-push-extend `(write-ho-value x ',name ',type ',formatter ,cdata s) print-func) (vector-push-extend '(write-string " s) print-func)) (defun ppfc-html-link-labels (label name type formatter cdata nlink print-func) (vector-push-extend '(write-string "" s) print-func) - (vector-push-extend `(write-string ,label s) print-func) + (vector-push-extend `(when (stringp ,label) (write-string ,label s)) print-func) (vector-push-extend '(write-string " " s) print-func) (ppfc-html-link name type formatter cdata nlink print-func)) -- 2.34.1