Skip to content

Commit

Permalink
removing one more condition as sonarcloud suggested same issue which …
Browse files Browse the repository at this point in the history
…I solved in this PR
  • Loading branch information
thebedigupta committed Oct 8, 2024
1 parent 6823c6b commit 14f9f9d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/generator/lib/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class Generator {
Object.defineProperty(this.templateParams, key, {
enumerable: true,
get: () => {
if (!this.templateConfig.parameters || this.templateConfig.parameters[key] == null) {
if (this.templateConfig.parameters?.[key] == null) {
throw new Error(
`Template parameter "${key}" has not been defined in the package.json file under generator property. Please make sure it's listed there before you use it in your template.`
);
Expand Down

0 comments on commit 14f9f9d

Please sign in to comment.