mirror of
https://github.com/containers/podman.git
synced 2025-06-19 08:09:12 +08:00
Merge pull request #4404 from jwhonce/wip/panic
Refactor test to prevent panic
This commit is contained in:
@ -68,7 +68,8 @@ func aliasFlags(f *pflag.FlagSet, name string) pflag.NormalizedName {
|
|||||||
// Check if a file exists and is not a directory
|
// Check if a file exists and is not a directory
|
||||||
func checkIfFileExists(name string) bool {
|
func checkIfFileExists(name string) bool {
|
||||||
file, err := os.Stat(name)
|
file, err := os.Stat(name)
|
||||||
if os.IsNotExist(err) {
|
// All errors return file == nil
|
||||||
|
if err != nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return !file.IsDir()
|
return !file.IsDir()
|
||||||
|
Reference in New Issue
Block a user