Closed
Description
I'm seeing this error when I try to validate starterproject in my devfile:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x1988416]
goroutine 1 [running]:
github.com/devfile/api/v2/pkg/validation.ValidateStarterProjects(0xc00009b5f0, 0x2, 0x2, 0x0, 0x0)
/Users/stephanie/go/pkg/mod/github.com/devfile/api/[email protected]/pkg/validation/projects.go:28 +0x136
It is because the CheckOutFrom
is nil, but the code is trying to get the value of CheckOutFrom.Remote
api/pkg/validation/projects.go
Line 28 in 019d88e
Need to check if CheckOutFrom != nil
before deference it.
Same check should also applys to:
api/pkg/validation/projects.go
Lines 61 to 62 in 019d88e