Skip to content

Commit

Permalink
fix:fix crash when os.Stat err(j is a symbolic link,but the file not …
Browse files Browse the repository at this point in the history
…exists)
  • Loading branch information
roadwy committed Dec 19, 2024
1 parent 4a73404 commit 9190628
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 9190628

Please sign in to comment.