fix: deal with the case that bufname is nil (#147)

ref https://github.com/nvim-telescope/telescope.nvim/issues/2552#issuecomment-1722543221
This commit is contained in:
JINNOUCHI Yasushi 2023-09-18 08:01:00 +09:00 committed by GitHub
parent 2119da4e3d
commit eaaabc90ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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