Skip to content

Rfem6 toolkit #140 pushing nodes with constraints triggers issue#141

Open
Arne-Martensen wants to merge 2 commits intodevelopfrom
RFEM6_Toolkit-#140-PushingNodesWithConstraintsTriggersIssue
Open

Rfem6 toolkit #140 pushing nodes with constraints triggers issue#141
Arne-Martensen wants to merge 2 commits intodevelopfrom
RFEM6_Toolkit-#140-PushingNodesWithConstraintsTriggersIssue

Conversation

@Arne-Martensen
Copy link
Contributor

Issues addressed by this PR

Closes #140

Fix NullReferenceException in RFEMNodalComparer.Equals() when pushing nodes without constraints to RFEM.

Test files

Changelog

  • Fixed RFEMNodalComparer to handle nodes with null supports without throwing
  • Refactored comparer: made NodeDistanceComparer a static readonly field, simplified null checks, removed redundant Equals() call

Additional comments

The root cause was that RFEMNodalComparer.Equals() did not account for Node.Support being null. While the null checks existed, a case-sensitivity typo on the field name (_nodecomp vs _nodeComp) prevented compilation, and the duplicate nodecomp.Equals() call at the end of the method was unnecessary. Took the opportunity to clean up the overall implementation.

…raints

- Add null handling for Node.Support in Equals() to allow pushing unconstrained nodes
- Make NodeDistanceComparer a static readonly field to avoid per-call allocation
- Simplify null checks using || instead of redundant symmetric conditions
- Remove duplicate nodecomp.Equals() call at end of method
@Arne-Martensen Arne-Martensen self-assigned this Mar 5, 2026
@Arne-Martensen Arne-Martensen added size:S Measured in minutes severity:critical No workaround exists. Essential to continue type:bug Error or unexpected behaviour labels Mar 5, 2026
@Arne-Martensen
Copy link
Contributor Author

@BHoMBot check compliance
@BHoMBot check installer
@BHoMBot check core
@BHoMBot check serialisation
@BHoMBot check null-handling

@bhombot-ci
Copy link

bhombot-ci bot commented Mar 5, 2026

@Arne-Martensen to confirm, the following actions are now queued:

  • check code-compliance
  • check documentation-compliance
  • check project-compliance
  • check branch-compliance
  • check dataset-compliance
  • check copyright-compliance
  • check installer
  • check core
  • check serialisation
  • check null-handling

@Arne-Martensen Arne-Martensen marked this pull request as ready for review March 5, 2026 09:34
@Arne-Martensen
Copy link
Contributor Author

@BHoMBot check versioning

@bhombot-ci
Copy link

bhombot-ci bot commented Mar 5, 2026

@Arne-Martensen to confirm, the following actions are now queued:

  • check versioning

There are 1 requests in the queue ahead of you.

@Arne-Martensen
Copy link
Contributor Author

@BHoMBot check versioning

@bhombot-ci
Copy link

bhombot-ci bot commented Mar 5, 2026

@Arne-Martensen to confirm, the following actions are now queued:

  • check versioning

There are 1 requests in the queue ahead of you.

@michaelhoehn
Copy link
Contributor

@BHoMBot check versioning

@bhombot-ci
Copy link

bhombot-ci bot commented Mar 5, 2026

@michaelhoehn to confirm, the following actions are now queued:

  • check versioning

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

Labels

severity:critical No workaround exists. Essential to continue size:S Measured in minutes type:bug Error or unexpected behaviour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pushing Nodes With Constraints Triggers Issue

2 participants