From 0346d3b16c42e6a05e34daa2fb91dddf8cfe714b Mon Sep 17 00:00:00 2001 From: Anthony Cowley Date: Wed, 19 Feb 2020 22:45:12 -0500 Subject: [PATCH] (bugfix): handle nil file names in `org-roam--org-roam-file-p` (#136) --- org-roam.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/org-roam.el b/org-roam.el index 3cf55aa..e5176f8 100644 --- a/org-roam.el +++ b/org-roam.el @@ -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."