Skip to content

Commit

Permalink
fixed issue that caused a panic in gpath IsDir
Browse files Browse the repository at this point in the history
  • Loading branch information
Davide bonomini committed Oct 8, 2024
1 parent d4c1f9f commit 2f30207
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/gpath/functions.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package gpath

import (
"github.com/getevo/evo/lib/text"
copy2 "github.com/otiai10/copy"
"io"
"io/ioutil"
"os"
"path/filepath"
"strings"

"github.com/getevo/evo/lib/log"
"github.com/getevo/evo/lib/text"
copy2 "github.com/otiai10/copy"
)

// MakePath create path recursive
Expand Down Expand Up @@ -45,7 +47,11 @@ func IsDirExist(path string) bool {
// IsDir checks if path is a directory
func IsDir(path string) bool {
info, err := os.Stat(path)
if os.IsNotExist(err) {
if err != nil {
if os.IsNotExist(err) {
return false
}
log.Error("Unable to access fs:", err.Error())
return false
}
return info.IsDir()
Expand Down

0 comments on commit 2f30207

Please sign in to comment.