branch: externals/denote
commit 2532464b001b9aa316103e415df91e73635780c6
Author: Hilde Rhyne <hilde.rh...@disroot.org>
Commit: Protesilaos Stavrou <i...@protesilaos.com>

    Make denote--current-file-is-note-p check for file
    
    This avoids errors when buffer-file-name returns a nil value.
---
 denote.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/denote.el b/denote.el
index 4e0edaf166..71648f9874 100644
--- a/denote.el
+++ b/denote.el
@@ -493,7 +493,8 @@ FILE must be an absolute path."
 
 (defun denote--current-file-is-note-p ()
   "Return non-nil if current file likely is a Denote note."
-  (and (or (string-match-p denote--id-regexp (buffer-file-name))
+  (and (buffer-file-name)
+       (or (string-match-p denote--id-regexp (buffer-file-name))
            (string-match-p denote--id-regexp (buffer-name)))
        (denote--default-dir-has-denote-prefix)))
 

Reply via email to