Fallback value

The `when' block would only return a string when the condition is
satisfied. If not, it returns `nil'. This is not acceptable, as
`postfix' is later used in a `concat'. This commit makes `postfix' an
empty string if the `when' condition fails in order to prevent this
concatenation issue.
This commit is contained in:
Lucien Cartier-Tilet 2022-08-24 03:03:43 +02:00
parent c303340523
commit bc48314435
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA

View File

@ -69,10 +69,9 @@ the variable `org-unique-id-prefix'."
prefix
org-unique-id-prefix))
(etime (org-reverse-string (org-id-time-to-b36)))
(postfix (when org-id-include-domain
(progn
(require 'message)
(concat "@" (message-make-fqdn))))))
(postfix (if org-id-include-domain
(concat "@" (message-make-fqdn))
"")))
(concat prefix "-" (car (split-string (concat etime postfix) "-")))))
;;;###autoload