Browse Source

Update 'src/app/core/drawers/drawer.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 try/catch to allow work under error
leo 2 years ago
parent
commit
fb18dc04c3
1 changed files with 9 additions and 2 deletions
  1. 9 2
      src/app/core/drawers/drawer.js

+ 9 - 2
src/app/core/drawers/drawer.js

@@ -49,8 +49,15 @@ export class Drawer {
     }
     }
 
 
   addAggregator (aggregator) {
   addAggregator (aggregator) {
-    this.addAction(new Action(aggregator.genericObject));
-    DrawerManager.addAggregator(aggregator);
+    var auxE = "";
+    try { // To avoid 'TypeError: cyclic object value'
+      auxE += "1, "; //D
+      this.addAction(new Action(aggregator.genericObject)); // app/core/models/application/actions/action.js
+      auxE += "2, "; //D
+      DrawerManager.addAggregator(aggregator);
+    } catch (error) {
+      console.log("drawer.js!addAggregator(aggregator): Error '" + error + "', with " + auxE);
+      }
     }
     }
 
 
   draw (object) {
   draw (object) {