branch: elpa/projectile
commit d91744559890dccafba76136f75218a10ab2a148
Author: Bozhidar Batsov <[email protected]>
Commit: Bozhidar Batsov <[email protected]>

    Don't store nil in project cache on corrupt/empty cache files
    
    When projectile-unserialize returns nil (corrupt or empty file),
    don't store nil in projectile-projects-cache. A nil entry prevents
    future reload attempts until the user manually invalidates.
---
 projectile.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/projectile.el b/projectile.el
index 1a4429e439..57b6ce489e 100644
--- a/projectile.el
+++ b/projectile.el
@@ -1154,7 +1154,9 @@ The cache is created both in memory and on the hard 
drive."
   "Load the cache file for PROJECT-ROOT in memory."
   (when-let* ((cache-file (projectile-project-cache-file project-root)))
     (when (file-exists-p cache-file)
-      (puthash project-root (projectile-unserialize cache-file) 
projectile-projects-cache))))
+      (when-let* ((data (projectile-unserialize cache-file)))
+        (puthash project-root data projectile-projects-cache)
+        data))))
 
 ;;;###autoload
 (defun projectile-purge-file-from-cache (file)

Reply via email to