Commit 0a11309f authored by Piotr Gawron's avatar Piotr Gawron
Browse files

copy line only if not null

parent 50e32778
......@@ -288,7 +288,9 @@ public class Reaction implements BioEntity {
throw new InvalidReactionParticipantNumberException(new ElementUtils().getElementTag(original)
+ "Invalid source reaction: number of reactants must be at least " + minReactants);
}
line = new PolylineData(original.getLine());
if (original.getLine() != null) {
line = new PolylineData(original.getLine());
}
}
public Reaction(String reactionId) {
......@@ -406,10 +408,10 @@ public class Reaction implements BioEntity {
/**
* Return list of all lines in the reaction that describe it.
*
* @return list of all lines that describes every connection in the rection
* @return list of all lines that describes every connection in the reaction
*/
public List<Line2D> getLines() {
List<Line2D> result = new ArrayList<Line2D>();
List<Line2D> result = new ArrayList<>();
for (AbstractNode node : nodes) {
result.addAll(node.getLine().getLines());
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment