Procházet zdrojové kódy

Update 'src/app/core/drawers/drawer-aggregator.js'

Previous debug message was provoking error in crationg of second Circumference c1: c0:=Circumference(A,B); c1:=Circumference(B,A);
In "addAggregator(aggregator)" added test "if (this.aggregators==undefined)" and try/catch to allow work under error
leo před 2 roky
rodič
revize
98466477a3
1 změnil soubory, kde provedl 15 přidání a 3 odebrání
  1. 15 3
      src/app/core/drawers/drawer-aggregator.js

+ 15 - 3
src/app/core/drawers/drawer-aggregator.js

@@ -47,10 +47,22 @@ export class DrawerAggregator {
   setElementClass (elementClass) {
     this.elementClass = elementClass;
     }
+
   addAggregator (aggregator) {
-    if (!this.aggregators.includes(aggregator)) {
-      this.aggregators.push(aggregator);
-      this.genericObject.dependentsOnThis.push(aggregator.genericObject);
+    if (this.aggregators==undefined) {
+      console.log("drawer-aggregator.js!addAggregator(aggregator): Error, 'this.aggregators==undefined'");
+      return;
+      }
+    var auxE = "1, ";
+    try {
+      if (!this.aggregators.includes(aggregator)) {
+        auxE += "2, "; //D
+        this.aggregators.push(aggregator);
+        auxE += "3, "; //D
+        this.genericObject.dependentsOnThis.push(aggregator.genericObject);
+        }
+    } catch (error) {
+      console.log("drawer-aggregator.js!addAggregator(aggregator): Error '" + error + "', with " + auxE);
       }
     }