From 6163d4bd297d52a4723bca9fa3de49814d54b4f0 Mon Sep 17 00:00:00 2001 From: delphinus Date: Mon, 18 Sep 2023 07:57:02 +0900 Subject: [PATCH] fix: deal with the case that bufname is nil ref https://github.com/nvim-telescope/telescope.nvim/issues/2552#issuecomment-1722543221 --- lua/frecency/fs.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/frecency/fs.lua b/lua/frecency/fs.lua index 6bf71629..9e6f1889 100644 --- a/lua/frecency/fs.lua +++ b/lua/frecency/fs.lua @@ -34,10 +34,10 @@ FS.new = function(config) return self end ----@param path string +---@param path string? ---@return boolean function FS:is_valid_path(path) - return Path:new(path):is_file() and not self:is_ignored(path) + return not not path and Path:new(path):is_file() and not self:is_ignored(path) end ---@param path string