瀏覽代碼

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) {