From afe5f3f6928f46bfabe403d473068b539cf36cff Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Sat, 17 Dec 2022 12:45:46 +0300 Subject: [PATCH] org-persist-gc: Fix edge case * lisp/org-persist.el (org-persist-gc): Do not err when `org-persist-directory' is absent. --- lisp/org-persist.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/org-persist.el b/lisp/org-persist.el index 57eac65b4..0c19d9125 100644 --- a/lisp/org-persist.el +++ b/lisp/org-persist.el @@ -999,7 +999,8 @@ Also, remove containers associated with non-existing files." (remote-files-num 0) (orphan-files (delete (org-file-name-concat org-persist-directory org-persist-index-file) - (directory-files-recursively org-persist-directory ".+")))) + (when (file-exists-p org-persist-directory) + (directory-files-recursively org-persist-directory ".+"))))) (dolist (collection org-persist--index) (let* ((file (plist-get (plist-get collection :associated) :file)) (web-file (and file (string-match-p "\\`https?://" file)))