Skip to content

Commit

Permalink
Merge pull request #208 from moznion/fix_nil_deref
Browse files Browse the repository at this point in the history
Fix unexpected nil dereference when it runs `lambroll init` for not-existed function
  • Loading branch information
fujiwara authored Dec 22, 2021
2 parents 73ebdbe + 2f8b5c6 commit bcfa187
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lambroll.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ func newFunctionFrom(c *lambda.FunctionConfiguration, code *lambda.FunctionCodeL
}
}

if aws.StringValue(code.RepositoryType) == "ECR" || aws.StringValue(fn.PackageType) == packageTypeImage {
if (code != nil && aws.StringValue(code.RepositoryType) == "ECR") || aws.StringValue(fn.PackageType) == packageTypeImage {
log.Printf("[debug] Image URL=%s", *code.ImageUri)
fn.PackageType = aws.String(packageTypeImage)
fn.Code = &lambda.FunctionCode{
Expand Down

0 comments on commit bcfa187

Please sign in to comment.