Skip to content

Commit 836f941

Browse files
CelestialCraftersammy-ette
authored andcommitted
fix: handle completion info check error (#330)
* fix: handle completion info check error fixes #329 * make changelog more descriptive
1 parent ac7c974 commit 836f941

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# 🎀 Changelog
22

3+
## Unreleased
4+
### Fixed
5+
- Skip over file and prevent panic if info cannot be retrieved during file completion (due to permission error or anything else)
6+
37
## [2.3.3] - 2024-11-04
48
### Fixed
59
- Heredocs having issues

complete.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,12 @@ func matchPath(query string) ([]string, string) {
157157

158158
files, _ := os.ReadDir(path)
159159
for _, entry := range files {
160-
// should we handle errors here?
161160
file, err := entry.Info()
162-
if err == nil && file.Mode() & os.ModeSymlink != 0 {
161+
if err != nil {
162+
continue
163+
}
164+
165+
if file.Mode() & os.ModeSymlink != 0 {
163166
path, err := filepath.EvalSymlinks(filepath.Join(path, file.Name()))
164167
if err == nil {
165168
file, err = os.Lstat(path)

0 commit comments

Comments
 (0)