mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
Produce less weird crash on non existing files
Former-commit-id: 74bb27bd53c685be530632994bd2ba24c1f362e1
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package obiconvert
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
@ -20,6 +21,9 @@ func _ExpandListOfFiles(check_ext bool, filenames ...string) ([]string, error) {
|
||||
err = filepath.Walk(fn,
|
||||
func(path string, info os.FileInfo, err error) error {
|
||||
var e error
|
||||
if info == nil {
|
||||
return fmt.Errorf("cannot open path")
|
||||
}
|
||||
for info.Mode()&os.ModeSymlink == os.ModeSymlink {
|
||||
path, e = filepath.EvalSymlinks(path)
|
||||
if e != nil {
|
||||
|
Reference in New Issue
Block a user