Explorar el Código

Fix bug when there is no hast for id locations

Report by Gerald, fix by David Maus.
Carsten Dominik hace 15 años
padre
commit
721e547cd9
Se han modificado 2 ficheros con 6 adiciones y 1 borrados
  1. 3 0
      lisp/ChangeLog
  2. 3 1
      lisp/org-id.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2010-02-26  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-id.el (org-id-find-id-file): Fix bug when there is no hash
+	table for the id locations.
+
 	* org.el (org-read-date-analyze): Match American-style dates, like
 	5/30 or 5/13/7.  Make sure cal-iso.el is loaded.  Don't force he
 	current year when reading ISO and American dates.

+ 3 - 1
lisp/org-id.el

@@ -545,7 +545,9 @@ When CHECK is given, prepare detailed information about duplicate IDs."
 (defun org-id-find-id-file (id)
   "Query the id database for the file in which this ID is located."
   (unless org-id-locations (org-id-locations-load))
-  (or (gethash id org-id-locations)
+  (or (and org-id-locations
+	   (hash-table-p org-id-locations)
+	   (gethash id org-id-locations))
       ;; ball back on current buffer
       (buffer-file-name (or (buffer-base-buffer (current-buffer))
 			    (current-buffer)))))