[Entanglement] Throw errors if validation is skipped

...per feedback from nasa/openmctweb#98
This commit is contained in:
Victor Woeltjen
2015-09-22 14:39:15 -07:00
parent ff24f06475
commit 119403e71c
3 changed files with 23 additions and 8 deletions

View File

@@ -64,6 +64,12 @@ define(
return self.perform(domainObject, parent);
}
if (!this.validate(domainObject, parent)) {
throw new Error(
"Tried to copy objects without validating first."
);
}
if (domainObject.hasCapability('composition')) {
model.composition = [];
}