From d91744559890dccafba76136f75218a10ab2a148 Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Sat, 28 Feb 2026 10:42:52 +0200 Subject: 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 1a4429e..57b6ce4 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) -- cgit v1.0