fix nil pointer dereference
This commit is contained in:
parent
00c61f9987
commit
3c346867f4
|
@ -251,8 +251,10 @@ func (s *StepRunSourceInstance) Run(ctx context.Context, state multistep.StateBa
|
||||||
if resp, e := ec2conn.DescribeInstances(describeInstance); e == nil {
|
if resp, e := ec2conn.DescribeInstances(describeInstance); e == nil {
|
||||||
if len(resp.Reservations) > 0 && len(resp.Reservations[0].Instances) > 0 {
|
if len(resp.Reservations) > 0 && len(resp.Reservations[0].Instances) > 0 {
|
||||||
instance := resp.Reservations[0].Instances[0]
|
instance := resp.Reservations[0].Instances[0]
|
||||||
ui.Error(fmt.Sprintf("Instance state change details: %s: %s",
|
if instance.StateTransitionReason != nil && instance.StateReason.Message != nil {
|
||||||
*instance.StateTransitionReason, *instance.StateReason.Message))
|
ui.Error(fmt.Sprintf("Instance state change details: %s: %s",
|
||||||
|
*instance.StateTransitionReason, *instance.StateReason.Message))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return multistep.ActionHalt
|
return multistep.ActionHalt
|
||||||
|
|
Loading…
Reference in New Issue