Skip to content

Commit

Permalink
Fix null OriginAccessIdentity crash
Browse files Browse the repository at this point in the history
  • Loading branch information
steadicat committed May 10, 2014
1 parent 8b62878 commit 6918dfb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ module.exports = function(options) {

// Update the distribution with the new default root object
data.DistributionConfig.DefaultRootObject = defaultRootObject;
if (data.DistributionConfig.Origins.Items[0].S3OriginConfig.OriginAccessIdentity === null) {
data.DistributionConfig.Origins.Items[0].S3OriginConfig.OriginAccessIdentity = '';
}
cloudfront.updateDistribution({
IfMatch: data.ETag,
Id: options.distributionId,
Expand Down

0 comments on commit 6918dfb

Please sign in to comment.