requiresReverse = true;
}
PipeRun other = endCP.getPipeRun();
- boolean mergeRuns = pipeRun.equalSpecs(other);
+ boolean mergeRuns = other == null ? true : pipeRun.equalSpecs(other);
if (requiresReverse) {
// Pipe line must be traversible with next/previous relations without direction change.
}
if (mergeRuns) {
// Runs have compatible specs and must be merged
- if (pipeRun != other) // FIXME: temporary workaround.
+ if (other != null && pipeRun != other)
PipingRules.merge(pipeRun, other);
+ else if (other == null) {
+ if (!(endTo instanceof Nozzle)) {
+ pipeRun.addChild(endTo);
+ } else {
+ endTo.setPipeRun(pipeRun);
+ }
+ }
if (!reversed) {
currentCP.setNext(endCP);
endCP.setPrevious(currentCP);