Commit b6531d9641271cc8cab87b64e9dce20b648d4a41

Thomas de Grivel 2018-06-18T10:11:08

css error without token

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/css-parser.lisp b/css-parser.lisp
index 2dd96a3..cf16d96 100644
--- a/css-parser.lisp
+++ b/css-parser.lisp
@@ -90,10 +90,12 @@
 
 (defmethod parser-error ((pr parser) &rest message)
   (let ((token (parser-token pr 0)))
-    (error "CSS error ~A:~A ~A"
-           (token-line token)
-           (token-character token)
-           (str message))))
+    (if token
+        (error "CSS error ~A:~A ~A"
+               (token-line token)
+               (token-character token)
+               (str message))
+        (error "CSS error ~A" (str message)))))
 
 (defmethod parse-component-value ((pr parser))
   (or (parse-function-block pr)