Skip to content

Commit

Permalink
fix(cache): handle corrupted cache files
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Mar 24, 2023
1 parent a80422f commit db5b67e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lua/lazy/core/cache.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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), ",")
Expand Down

0 comments on commit db5b67e

Please sign in to comment.