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
|
---@type string
|
||||||
local data = fd:read("*a")
|
local data = fd:read("*a")
|
||||||
fd:close()
|
fd:close()
|
||||||
---@diagnostic disable-next-line: assign-type-mismatch
|
local ok, decoded = pcall(require("string.buffer").decode, data)
|
||||||
self.data = require("string.buffer").decode(data) or {}
|
self.data = ok and decoded or {} --[[@as table<string, number>]]
|
||||||
end
|
end
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue