mirror of
https://github.com/hashicorp/packer.git
synced 2026-09-20 23:11:40 -04:00
fix crash that occurs when dir is nil
This commit is contained in:
@@ -49,7 +49,10 @@ func (a *artifact) State(name string) interface{} {
|
||||
}
|
||||
|
||||
func (a *artifact) Destroy() error {
|
||||
return a.dir.RemoveAll()
|
||||
if a.dir != nil {
|
||||
return a.dir.RemoveAll()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func NewArtifact(remoteType string, format string, exportOutputPath string, vmName string, skipExport bool, keepRegistered bool, state multistep.StateBag) (packer.Artifact, error) {
|
||||
|
||||
Reference in New Issue
Block a user