From 8d638aaa751df78028ad85e822b28a0cbbff8ca6 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 27 Jun 2013 18:50:02 -0400 Subject: [PATCH] packer: Don't run post-processors if artifact is nil --- packer/build.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packer/build.go b/packer/build.go index c0d4b77d0..29ebe49a7 100644 --- a/packer/build.go +++ b/packer/build.go @@ -161,6 +161,12 @@ func (b *coreBuild) Run(ui Ui, cache Cache) ([]Artifact, error) { return nil, err } + // If there was no result, don't worry about running post-processors + // because there is nothing they can do, just return. + if builderArtifact == nil { + return nil, nil + } + errors := make([]error, 0) keepOriginalArtifact := len(b.postProcessors) == 0