summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan-W. Hahn <stefan.hahn@s-hahn.de>2014-02-21 17:19:39 +0100
committerNicolas Goaziou <n.goaziou@gmail.com>2014-02-24 17:32:14 +0100
commit2e72176e211604e364f1a3ec8620b83b99e6e50e (patch)
tree51d59c805c99ddc801eda5bbdb469e225d1bb6c0
parent4298a21b825efb58ed069693f453c962d309110a (diff)
downloadorg-mode-2e72176e211604e364f1a3ec8620b83b99e6e50e.tar.gz
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>
-rw-r--r--lisp/org-bibtex.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/org-bibtex.el b/lisp/org-bibtex.el
index b4e6977..d89da85 100644
--- a/lisp/org-bibtex.el
+++ b/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