فهرست منبع

org-bibtex: Fix `org-bibtex-read' on an empty field

* lisp/org-bibtex.el (org-bibtex-read): Check string length before
  using aref.

If a field in a bibtex entry is empty:

@article(test,
   description = "")

the function org-bibtex-read throws an exception because of
using aref on this empty string.

The solution is to check the length of the string before.

TINYCHANGE

Signed-off-by: Stefan-W. Hahn <stefan.hahn@s-hahn.de>
Stefan-W. Hahn 11 سال پیش
والد
کامیت
2e72176e21
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      lisp/org-bibtex.el

+ 2 - 1
lisp/org-bibtex.el

@@ -613,7 +613,8 @@ This uses `bibtex-parse-entry'."
 	(strip-delim
 	 (lambda (str)	     ; strip enclosing "..." and {...}
 	   (dolist (pair '((34 . 34) (123 . 125) (123 . 125)))
-	     (when (and (= (aref str 0) (car pair))
+	     (when (and (> (length str) 1)
+			(= (aref str 0) (car pair))
 			(= (aref str (1- (length str))) (cdr pair)))
 	       (setf str (substring str 1 (1- (length str)))))) str)))
     (push (mapcar