Skip to content

Commit

Permalink
Merge pull request #272 from roadwy/main
Browse files Browse the repository at this point in the history
fix:fix crash when os.Stat err(j is a symbolic link,but the file not exist)
  • Loading branch information
slimm609 authored Dec 30, 2024
2 parents 90b405c + 9190628 commit c72ab7c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/utils/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ func GetAllFilesFromDir(dirName string, recursive bool) []string {
fileList, _ = filepath.Glob(fmt.Sprintf("%s/*", dirName))
for _, j := range fileList {
dirInfo, _ := os.Stat(j)
if dirInfo == nil {
continue
}
if j != "." && !dirInfo.IsDir() && CheckIfElf(j) {
results = append(results, j)
}
Expand Down

0 comments on commit c72ab7c

Please sign in to comment.