Permalink
Browse files

Fix bug with published port values.

We check if the published port is on the child node we're rendering,
and only add it to the port arguments when appropriate.

Otherwise we'd have problems with ports that are the same instance
(which is common with immutable values) but are on a different node.
  • Loading branch information...
1 parent dc4ebb1 commit 5d64292c1c34a6240b792bc2a13e28a891d4102f @fdb fdb committed Sep 19, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/main/java/nodebox/node/NodeContext.java
@@ -152,9 +152,11 @@ public double getFrame() {
for (Map.Entry<Port, ?> argumentEntry : networkArgumentMap.entrySet()) {
Port networkPort = argumentEntry.getKey();
checkState(networkPort.isPublishedPort(), "Given port %s is not a published port.", networkPort);
- Port childPort = networkPort.getChildPort(network);
- List<?> values = preprocessInput(networkPort, childPort, argumentEntry.getValue());
- portArguments.put(childPort, values);
+ if (networkPort.getChildNode(network) == child) {
+ Port childPort = networkPort.getChildPort(network);
+ List<?> values = preprocessInput(networkPort, childPort, argumentEntry.getValue());
+ portArguments.put(childPort, values);
+ }
}
// A prepared list of argument lists, each for one invocation of the child node.

0 comments on commit 5d64292

Please sign in to comment.