Skip to content

Commit

Permalink
fix(cache): clear cached entry on errors
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Dec 30, 2022
1 parent d50eab2 commit def5cc5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/lazy/core/cache.lua
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,11 @@ function M.load(modkey, modpath)
end

chunk, err = M._loadfile(entry.modpath)
M.dirty = true
if chunk then
M.dirty = true
entry.chunk = string.dump(chunk)
else
M.cache[modkey] = nil
end
return chunk, err
end
Expand Down

0 comments on commit def5cc5

Please sign in to comment.