From b3d01c59ba4ab4183b12e9e10bc1fcbbef1b02be Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 30 Oct 2025 10:20:43 +0100 Subject: [PATCH] fix(picker.util): ignore errors from corrupted kv stores. Closes #2394 --- lua/snacks/picker/util/kv.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/snacks/picker/util/kv.lua b/lua/snacks/picker/util/kv.lua index 5dc3b922..53d7000b 100644 --- a/lua/snacks/picker/util/kv.lua +++ b/lua/snacks/picker/util/kv.lua @@ -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]] end return self end