Skip to content

Commit

Permalink
Merge pull request #1288 from stack72/b-aws-instance-userdata-guard-581
Browse files Browse the repository at this point in the history
resource/aws_instance: Guard check for aws_instance UserData to prevent panic
  • Loading branch information
grubernaut authored Jul 31, 2017
2 parents c7d5987 + 8ef10eb commit 0bd2508
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion aws/resource_aws_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ func resourceAwsInstanceRead(d *schema.ResourceData, meta interface{}) error {
if err != nil {
return err
}
if attr.UserData.Value != nil {
if attr.UserData != nil && attr.UserData.Value != nil {
d.Set("user_data", userDataHashSum(*attr.UserData.Value))
}
}
Expand Down

0 comments on commit 0bd2508

Please sign in to comment.