Produce less weird crash on non existing files

Former-commit-id: 74bb27bd53c685be530632994bd2ba24c1f362e1
This commit is contained in:
2023-03-07 17:34:25 +07:00
parent fbfed52508
commit b3922c3896
21 changed files with 147 additions and 32 deletions

View File

@ -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 {