From eaaabc90ed082b84a2e9b0ce4ab8c6753b7c50f9 Mon Sep 17 00:00:00 2001 From: JINNOUCHI Yasushi Date: Mon, 18 Sep 2023 08:01:00 +0900 Subject: [PATCH] fix: deal with the case that bufname is nil (#147) 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 6bf7162..9e6f188 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