diff --git a/model/src/main/java/lcsb/mapviewer/model/map/model/ModelFullIndexed.java b/model/src/main/java/lcsb/mapviewer/model/map/model/ModelFullIndexed.java index 9d32b9e7ace09a41c7705284aa2c0d9c97e20a98..93768e9ab66cc5e8c8b5e80e85da9da920efd178 100644 --- a/model/src/main/java/lcsb/mapviewer/model/map/model/ModelFullIndexed.java +++ b/model/src/main/java/lcsb/mapviewer/model/map/model/ModelFullIndexed.java @@ -173,6 +173,9 @@ public class ModelFullIndexed implements Model { @Override public void addReaction(Reaction reaction) { modelData.addReaction(reaction); + if (reactionByReactionId.get(reaction.getIdReaction()) != null) { + throw new InvalidArgumentException("Reaction with id already exists: " + reaction.getElementId()); + } reactionByReactionId.put(reaction.getIdReaction(), reaction); reactionByDbId.put(reaction.getId(), reaction); }