Skip to content
Snippets Groups Projects
Commit b40f9809 authored by rhenck's avatar rhenck
Browse files

Extend Unit validation for state variables

Disallow state variables without alias.
parent cfa3bad7
No related branches found
No related tags found
No related merge requests found
...@@ -57,6 +57,11 @@ export class Unit implements UnitProperties { ...@@ -57,6 +57,11 @@ export class Unit implements UnitProperties {
function isValid(blueprint?: UnitProperties): boolean { function isValid(blueprint?: UnitProperties): boolean {
if (!blueprint) return false; if (!blueprint) return false;
if (blueprint.stateVariables !== undefined &&
blueprint.stateVariables.length > 0 &&
blueprint.stateVariables[0].alias === undefined) {
return false;
}
return blueprint.version === VersionManager.getCurrentVersion() && return blueprint.version === VersionManager.getCurrentVersion() &&
blueprint.stateVariables !== undefined && blueprint.stateVariables !== undefined &&
blueprint.type !== undefined && blueprint.type !== undefined &&
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment