From 636d0e7d11b9ddfb58faebb6a23a9dda58b79508 Mon Sep 17 00:00:00 2001 From: fujiwara Date: Thu, 1 Feb 2024 15:23:17 +0900 Subject: [PATCH] fix failed to diff when a remote function is not found. newFunctionFrom() and fillDefaultValues() care the remote function configuration is not found. --- lambroll.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lambroll.go b/lambroll.go index 75324a8..4aa103d 100644 --- a/lambroll.go +++ b/lambroll.go @@ -258,7 +258,7 @@ func (app *App) loadFunction(path string) (*Function, error) { func newFunctionFrom(c *types.FunctionConfiguration, code *types.FunctionCodeLocation, tags Tags) *Function { if c == nil { - return &Function{} + return nil } fn := &Function{ Architectures: c.Architectures, @@ -319,6 +319,9 @@ func newFunctionFrom(c *types.FunctionConfiguration, code *types.FunctionCodeLoc } func fillDefaultValues(fn *Function) { + if fn == nil { + return + } if len(fn.Architectures) == 0 { fn.Architectures = []types.Architecture{types.ArchitectureX8664} }