mirror of
https://github.com/folke/snacks.nvim
synced 2025-12-23 08:47:57 +00:00
fix(picker.util): ignore errors from corrupted kv stores. Closes #2394
This commit is contained in:
parent
6cf2fee619
commit
b3d01c59ba
1 changed files with 2 additions and 2 deletions
|
|
@ -28,8 +28,8 @@ function M.new(path, opts)
|
|||
---@type string
|
||||
local data = fd:read("*a")
|
||||
fd:close()
|
||||
---@diagnostic disable-next-line: assign-type-mismatch
|
||||
self.data = require("string.buffer").decode(data) or {}
|
||||
local ok, decoded = pcall(require("string.buffer").decode, data)
|
||||
self.data = ok and decoded or {} --[[@as table<string, number>]]
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue