Преглед изворни кода

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 година
родитељ
комит
fb18dc04c3
1 измењених фајлова са 9 додато и 2 уклоњено
  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) {
-    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) {