Skip to content

Commit

Permalink
Empty properties are not fatal errors anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
joswarmer committed Nov 19, 2024
1 parent 7b2ad26 commit 91757f6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ export class NonOptionalsCheckerTemplate {
}

result += `if (modelelement.${prop.name} === null || modelelement.${prop.name} === undefined ${additionalStringCheck}) {
hasFatalError = true;
this.errorList.push(new ${Names.FreError}("Property '${prop.name}' must have a value", modelelement, ${locationdescription}, '${prop.name}', ${Names.FreErrorSeverity}.Error));
}
`;
Expand All @@ -95,9 +94,8 @@ export class NonOptionalsCheckerTemplate {
this.done.push(concept);
return `${commentBefore}
public execBefore${Names.classifier(concept)}(modelelement: ${Names.classifier(concept)}): boolean {
let hasFatalError: boolean = false;
${result}
return hasFatalError;
return false;
}`;
} else {
return ``;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,11 @@ export class ReferenceCheckerTemplate {
result += `for (const referredElem of modelelement.${prop.name} ) {
if (referredElem.referred === null) {
this.makeErrorMessage(modelelement, referredElem, "${prop.name}", \`\${${locationdescription}}\`);
hasFatalError = true;
}
}`;
} else {
result += `if (!!modelelement.${prop.name} && modelelement.${prop.name}.referred === null) {
this.makeErrorMessage(modelelement, modelelement.${prop.name}, "${prop.name}", \`\${${locationdescription}}\`);
hasFatalError = true;
}`;
}
}
Expand All @@ -102,9 +100,8 @@ export class ReferenceCheckerTemplate {
* @param modelelement
*/
public execBefore${Names.classifier(concept)}(modelelement: ${Names.classifier(concept)}): boolean {
let hasFatalError: boolean = false;
${result}
return hasFatalError;
return false;
}`;
} else {
return ``;
Expand Down

0 comments on commit 91757f6

Please sign in to comment.