org-persist-gc: Fix edge case

* lisp/org-persist.el (org-persist-gc): Do not err when
`org-persist-directory' is absent.
This commit is contained in:
Ihor Radchenko 2022-12-17 12:45:46 +03:00
parent d52a775369
commit afe5f3f692
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 2 additions and 1 deletions

View File

@ -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)))