Commit 8abc6dd1 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

Merge pull request #375 from justinsb/avoid_nil_pointer_if_no_openstack_image

builder/openstack: If no image is generated, just return nil 
parents d8b04866 6ebfb9e1
...@@ -112,6 +112,11 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe ...@@ -112,6 +112,11 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
return nil, rawErr.(error) 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 // Build the artifact and return it
artifact := &Artifact{ artifact := &Artifact{
ImageId: state.Get("image").(string), ImageId: state.Get("image").(string),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment