From 2300b102b7f87c73c62f4ac0c90e6f5fe1130dea Mon Sep 17 00:00:00 2001 From: Rickard von Essen Date: Wed, 8 Mar 2017 18:12:37 +0100 Subject: [PATCH] amazon: Step Region Copy crashing on device mapping Closes #4635 --- builder/amazon/common/step_ami_region_copy.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/builder/amazon/common/step_ami_region_copy.go b/builder/amazon/common/step_ami_region_copy.go index 1f4e65738..96496fe47 100644 --- a/builder/amazon/common/step_ami_region_copy.go +++ b/builder/amazon/common/step_ami_region_copy.go @@ -2,7 +2,6 @@ package common import ( "fmt" - "sync" "github.com/aws/aws-sdk-go/aws" @@ -128,7 +127,7 @@ func amiRegionCopy(state multistep.StateBag, config *AccessConfig, name string, } for _, blockDeviceMapping := range describeImageResp.Images[0].BlockDeviceMappings { - if blockDeviceMapping.Ebs != nil { + if blockDeviceMapping.Ebs != nil && blockDeviceMapping.Ebs.SnapshotId != nil { snapshotIds = append(snapshotIds, *blockDeviceMapping.Ebs.SnapshotId) } }