From 994be97397a8de4c7217a8f089514d91053a2f8a Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Sat, 26 Sep 2020 15:12:28 +0200 Subject: [PATCH] Fix consistency check for link finder function --- site-lisp/db-org.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/site-lisp/db-org.el b/site-lisp/db-org.el index 0adc50b..11201d3 100644 --- a/site-lisp/db-org.el +++ b/site-lisp/db-org.el @@ -607,9 +607,13 @@ if in Org Mode." (interactive (when (derived-mode-p 'org-mode) (list (org-id-get) (org-entry-get nil "CUSTOM_ID")))) - (unless (string-match-p "^[a-f0-9]\\{8\\}-[a-f0-9]\\{4\\}-[a-f0-9]\\{4\\}-[a-f0-9]\\{4\\}-[a-f0-9]\\{12\\}$" id) + (unless (or (not id) + (and (stringp id) + (string-match-p "^[a-f0-9]\\{8\\}-[a-f0-9]\\{4\\}-[a-f0-9]\\{4\\}-[a-f0-9]\\{4\\}-[a-f0-9]\\{12\\}$" id))) (user-error "Given ID is not a valid UUID: %s" id)) - (unless (string-match-p "[-a-zA-Z0-9]" custom-id) + (unless (or (not custom-id) + (and (stringp custom-id) + (string-match-p "[-a-zA-Z0-9]" custom-id))) ;; sorry, only ASCII right now … (user-error "CUSTOM_ID must consist of alphanumeric charaters only"))