Skip to content

Commit

Permalink
fix: deal with the case that bufname is nil (#147)
Browse files Browse the repository at this point in the history
  • Loading branch information
delphinus authored Sep 17, 2023
1 parent 2119da4 commit eaaabc9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/frecency/fs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit eaaabc9

Please sign in to comment.