瀏覽代碼

org-persist-gc: Fix when expiry is days and data is freshly created

Ihor Radchenko 3 年之前
父節點
當前提交
1c79af13df
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      lisp/org-persist.el

+ 3 - 2
lisp/org-persist.el

@@ -756,10 +756,11 @@ Do nothing in an indirect buffer."
      (`nil t)
      (`never nil)
      ((pred numberp)
-      (<= (float-time) (+ (plist-get ,collection :access-time) (* ,cnd 24 60 60))))
+      (when (plist-get ,collection :access-time)
+        (<= (float-time) (+ (plist-get ,collection :access-time) (* ,cnd 24 60 60)))))
      ((pred functionp)
       (funcall ,cnd ,collection))
-     (_ (error "org-persist: Unsupported expiry type %S" cnd))))
+     (_ (error "org-persist: Unsupported expiry type %S" ,cnd))))
 
 (defun org-persist-gc ()
   "Remove expired or unregisted containers.