Skip to content

Commit

Permalink
props null fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriy-yarosh committed Jul 11, 2024
1 parent e8d44ea commit b55c952
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/import/codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ export function generateHelmConstruct(typegen: TypeGenerator, def: HelmObjectDef
code.close('}');
code.close('}');
code.line();
code.line('const { additionalValues, ...valuesWithoutAdditionalValues } = props;');
code.line('const { additionalValues, ...valuesWithoutAdditionalValues } = props || {};');
code.line();
code.open('return {');
code.line('...valuesWithoutAdditionalValues,');
Expand All @@ -421,4 +421,4 @@ export function generateHelmConstruct(typegen: TypeGenerator, def: HelmObjectDef

function hasRequiredProps(schema: JSONSchema4):boolean | undefined {
return schema?.required && Array.isArray(schema.required) && schema.required.length > 0;
}
}

0 comments on commit b55c952

Please sign in to comment.