Skip to content

Commit b870527

Browse files
authored
Merge pull request #69 from slim01/master
fix problem in edge compability (#50)
2 parents bbdaccf + 28b3af4 commit b870527

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/components/blocks/blocks.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,6 @@ Blocks.prototype.addEdge = function(blockOut, fieldOut, blockIn, fieldIn, isData
708708
if (!this.areTypesCompatible(fieldIn, fieldOut)) {
709709
throw 'Types are not compatible';
710710
}
711-
712711
// Check whether the data type allows multiple input edges
713712
if (fieldIn.getEdgeCount() > 0 && !fieldIn.allowsMultipleEdges()) {
714713
throw 'Parameter accepts only one input';
@@ -837,8 +836,8 @@ Blocks.prototype.importProcessGraph = function(processGraph, registry) {
837836

838837
// Import edges
839838
var nodes = pg.getNodes();
840-
for(let i in nodes) {
841-
var node = nodes[i];
839+
// iterating using for in loop causes error in edge
840+
Object.values(nodes).forEach(node => {
842841

843842
var args = node.getArgumentNames();
844843
for(let i in args) {
@@ -867,7 +866,7 @@ Blocks.prototype.importProcessGraph = function(processGraph, registry) {
867866
break;
868867
}
869868
}
870-
}
869+
});
871870
},
872871

873872
Blocks.prototype.importNodesFromProcessGraph = function(nodes, x = 0, y = 0) {

src/components/blocks/field.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ class Field extends ProcessSchema {
141141
else {
142142
var errorMsg = "Can't determine which object property this input should be assigned to. Please specify manually in Process Graph mode.";
143143
console.warn(errorMsg);
144-
this.block.blocks.showError(errorMsg);
144+
throw errorMsg;
145145
// ToDo: It is not quite clear what to do when multiple refs are available.
146146
}
147147
}

0 commit comments

Comments
 (0)