Skip to content

Commit

Permalink
avoid logging nil error
Browse files Browse the repository at this point in the history
  • Loading branch information
cdzombak committed Sep 25, 2023
1 parent 87fa035 commit 2dc8d56
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,10 @@ func main() {
u, err := user.LookupId(strconv.Itoa(*asUID))
if err != nil && u != nil {
userHome = u.HomeDir
} else {
} else if err != nil {
log.Printf("cannot find homedir for UID %d (%s); HOME will not be changed", *asUID, err)
} else {
log.Printf("cannot find homedir for UID %d; HOME will not be changed.", *asUID)
}
}
}
Expand Down

0 comments on commit 2dc8d56

Please sign in to comment.