mirror of
https://github.com/nasa/openmct.git
synced 2024-12-18 20:57:53 +00:00
[API] Throw error on containment violation
This commit is contained in:
parent
11409ce509
commit
1de26d3c5d
@ -52,6 +52,9 @@ define([
|
||||
if (!this._children) {
|
||||
throw new Error("Must load composition before you can add!");
|
||||
}
|
||||
if (!this.canContain(child)) {
|
||||
throw new Error("This object cannot contain that object.");
|
||||
}
|
||||
if (this.contains(child)) {
|
||||
if (skipMutate) {
|
||||
return; // don't add twice, don't error.
|
||||
|
Loading…
Reference in New Issue
Block a user