(bugfix): handle nil file names in org-roam--org-roam-file-p (#136)

This commit is contained in:
Anthony Cowley
2020-02-19 22:45:12 -05:00
committed by GitHub
parent 63754d1ccd
commit 0346d3b16c

View File

@@ -166,8 +166,9 @@ If called interactively, then PARENTS is non-nil."
"Return t if FILE is part of org-roam system, defaulting to the name of the current buffer. Else, return nil."
(let ((path (or file
(buffer-file-name (current-buffer)))))
(f-descendant-of-p (file-truename path)
(file-truename org-roam-directory))))
(and path
(f-descendant-of-p (file-truename path)
(file-truename org-roam-directory)))))
(defun org-roam--get-title-from-cache (file)
"Return title of `FILE' from the cache."