branch: externals/org
commit afe5f3f6928f46bfabe403d473068b539cf36cff
Author: Ihor Radchenko <[email protected]>
Commit: Ihor Radchenko <[email protected]>

    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 57eac65b4a..0c19d91254 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)))

Reply via email to