From ec75913412f441386b4113b048bce3263bbdf055 Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Tue, 27 Nov 2018 16:34:26 -0800 Subject: [PATCH] fix crash that occurs when dir is nil --- builder/vmware/common/artifact.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/builder/vmware/common/artifact.go b/builder/vmware/common/artifact.go index b8056e544..c9fa075d2 100644 --- a/builder/vmware/common/artifact.go +++ b/builder/vmware/common/artifact.go @@ -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) {