mirror of
https://github.com/containers/podman.git
synced 2026-03-13 08:01:19 +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
|
||||
func checkIfFileExists(name string) bool {
|
||||
file, err := os.Stat(name)
|
||||
if os.IsNotExist(err) {
|
||||
// All errors return file == nil
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
return !file.IsDir()
|
||||
|
||||
Reference in New Issue
Block a user