From db5b67e75c31c955e3df9a3d6781f397b9dc66e8 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 24 Mar 2023 21:22:13 +0100 Subject: [PATCH] fix(cache): handle corrupted cache files --- lua/lazy/core/cache.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/lazy/core/cache.lua b/lua/lazy/core/cache.lua index e988dae..d60d271 100644 --- a/lua/lazy/core/cache.lua +++ b/lua/lazy/core/cache.lua @@ -141,6 +141,9 @@ function Loader.read(name) uv.fs_close(f) local zero = data:find("\0", 1, true) + if not zero then + return + end ---@type integer[]|{[0]:integer} local header = vim.split(data:sub(1, zero - 1), ",")