Skip to content

Conversation

@louisgreiner
Copy link
Contributor

@louisgreiner louisgreiner commented Oct 7, 2025

Description

We use to have no type check for undefined node

Also removed an unused occurrence of this method.

Issues

Fixes OpenRailAssociation/osrd#13531

This could have been prevented if we had this config

Checklist

  • This PR contains a description of the changes I'm making
  • I've read the Contribution Guidelines
  • CI is currently green and this is ready for review

Also removed an unused occurrence of this method.

Signed-off-by: Louis Greiner <[email protected]>
this.nodesStore.nodes.forEach((node) => {
node.getPorts().forEach((port) => {
const oppositeNode = node.getOppositeNode(port.getTrainrunSection());
if (oppositeNode === undefined) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I don't think this should ever happen?

getOppositeNode() only returns undefined when the trainrun section doesn't start/end at the node. Here, since we're iterating over the node's ports, the trainrun section necessarily starts or ends at the node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

error when opening macro editor

2 participants