Prechádzať zdrojové kódy

Merge branch 'bugfix'

Ihor Radchenko 3 rokov pred
rodič
commit
dbcc2e04f9
1 zmenil súbory, kde vykonal 8 pridanie a 1 odobranie
  1. 8 1
      lisp/oc-basic.el

+ 8 - 1
lisp/oc-basic.el

@@ -189,7 +189,14 @@ Return a hash table with citation references as keys and fields alist as values.
                                 (cons 'year
                                       (cond
                                        ((consp date)
-                                        (caar date))
+                                         (let ((year (caar date)))
+                                           (cond
+                                             ((numberp year) (number-to-string year))
+                                             ((stringp year) year)
+                                             (t
+                                               (error
+                                                 "First element of CSL-JSON date-parts should be a number or string, got %s: %S"
+                                                 (type-of year) year)))))
                                        ((stringp date)
                                         (replace-regexp-in-string
                                           (rx