Need a null check for iamProfile.

This commit is contained in:
Gian Merlino 2015-03-10 17:52:07 -07:00
parent b810cdfe58
commit b00c243786
1 changed files with 5 additions and 1 deletions

View File

@ -118,7 +118,11 @@ public class EC2AutoScaler implements AutoScaler<EC2EnvironmentConfig>
.withPlacement(new Placement(envConfig.getAvailabilityZone())) .withPlacement(new Placement(envConfig.getAvailabilityZone()))
.withKeyName(workerConfig.getKeyName()) .withKeyName(workerConfig.getKeyName())
.withSubnetId(workerConfig.getSubnetId()) .withSubnetId(workerConfig.getSubnetId())
.withIamInstanceProfile(workerConfig.getIamProfile().toIamInstanceProfileSpecification()) .withIamInstanceProfile(
workerConfig.getIamProfile() == null
? null
: workerConfig.getIamProfile().toIamInstanceProfileSpecification()
)
.withUserData(userDataBase64) .withUserData(userDataBase64)
); );