Skip to content

Commit 98f8c77

Browse files
committed
Fix potential nil error in generator
Fix potential nil error in generator if attempting to update JSON schema for a field that has the 'endpoints' property but isn't a ContainerComponent (e.g. a Pod spec). Signed-off-by: Angel Misevski <[email protected]>
1 parent 0d50b8c commit 98f8c77

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

generator/schemas/gen.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ This is not the case in the "%s' API group:
288288
return
289289
}
290290
for propName, prop := range schema.Properties {
291-
if propName == "endpoints" {
291+
if propName == "endpoints" && prop.Items != nil && prop.Items.Schema != nil {
292292
for endpointPropName, endpointProp := range prop.Items.Schema.Properties {
293293
if endpointPropName == "name" {
294294
if schemaGenerateMarker.ShortenEndpointNameLength {

0 commit comments

Comments
 (0)