Skip to content

Commit

Permalink
checked if path is empty string or not
Browse files Browse the repository at this point in the history
Signed-off-by: Neeraj Nagure <[email protected]>
  • Loading branch information
NeerajNagure committed Apr 22, 2024
1 parent 72ceb7b commit edfd55d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions common/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -1106,6 +1106,9 @@ func ReverseInPlace[T interface{}](xs []T) {
// Also returns true if the paths are the same.
func IsParent(child, parent string) bool {
var err error
if parent == "" || child == "" {
return false
}
child, err = filepath.Abs(child)
if err != nil {
logrus.Fatalf("Failed to make the path %s absolute. Error: %s", child, err)
Expand Down

0 comments on commit edfd55d

Please sign in to comment.