Skip to content

Commit

Permalink
Merge pull request #347 from fujiwara/fix/init-segfault
Browse files Browse the repository at this point in the history
fix segfault when creating a new function.
  • Loading branch information
fujiwara authored Jan 26, 2024
2 parents 924a294 + 8fbee67 commit d5a5825
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion init.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ func (app *App) Init(ctx context.Context, opt *InitOption) error {
tags = res.Tags
}

fn := newFunctionFrom(c, res.Code, tags)
var code *types.FunctionCodeLocation
if res != nil {
code = res.Code
}
fn := newFunctionFrom(c, code, tags)

if opt.DownloadZip && res.Code != nil && *res.Code.RepositoryType == "S3" {
log.Printf("[info] downloading %s", FunctionZipFilename)
Expand Down

0 comments on commit d5a5825

Please # to comment.