Merge pull request #375 from justinsb/avoid_nil_pointer_if_no_openstack_image

builder/openstack: If no image is generated, just return nil
This commit is contained in:
Mitchell Hashimoto 2013-08-31 22:01:55 -07:00
commit 8abc6dd178
1 changed files with 5 additions and 0 deletions

View File

@ -112,6 +112,11 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
return nil, rawErr.(error)
}
// If there are no images, then just return
if _, ok := state.GetOk("image"); !ok {
return nil, nil
}
// Build the artifact and return it
artifact := &Artifact{
ImageId: state.Get("image").(string),