2
2
镜像来自 https://github.com/Hilbis/Hilbish synced 2025-07-15 15:22:03 +00:00

fix: handle completion info check error (#330)

* fix: handle completion info check error
fixes Rosettea/Hilbish#329

* make changelog more descriptive
This commit is contained in:
CelestialCrafter 2024-11-22 18:20:43 -06:00 committed by GitHub
父節點 ac7c97442e
當前提交 36ce05e85a
沒有發現已知的金鑰在資料庫的簽署中
GPG Key ID: B5690EEEBB952194
共有 2 個文件被更改,包括 9 次插入2 次删除

查看文件

@ -1,5 +1,9 @@
# 🎀 Changelog
## Unreleased
### Fixed
- Skip over file and prevent panic if info cannot be retrieved during file completion (due to permission error or anything else)
## [2.3.3] - 2024-11-04
### Fixed
- Heredocs having issues

查看文件

@ -157,9 +157,12 @@ func matchPath(query string) ([]string, string) {
files, _ := os.ReadDir(path)
for _, entry := range files {
// should we handle errors here?
file, err := entry.Info()
if err == nil && file.Mode() & os.ModeSymlink != 0 {
if err != nil {
continue
}
if file.Mode() & os.ModeSymlink != 0 {
path, err := filepath.EvalSymlinks(filepath.Join(path, file.Name()))
if err == nil {
file, err = os.Lstat(path)