diff --git a/internal/core/manager.go b/internal/core/manager.go index e6ccc05..ff27740 100644 --- a/internal/core/manager.go +++ b/internal/core/manager.go @@ -41,10 +41,8 @@ func NewArtifactManager(config ArtConfig) (*ArtifactManager, error) { } finfo, err := os.Stat(baseDir) - if err == nil { - if !finfo.IsDir() { - return nil, errors.New(baseDir + " is not a directory") - } + if err != nil || !finfo.IsDir() { + return nil, errors.New(baseDir + " is not a directory") } // init the metadata path