Skip to content

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

Merged
peterjamesnugent merged 2 commits intodevelopfrom
RFEM6_Toolkit-#140-PushingNodesWithConstraintsTriggersIssue
Mar 6, 2026
Merged

Rfem6 toolkit #140 pushing nodes with constraints triggers issue#141
peterjamesnugent merged 2 commits intodevelopfrom
RFEM6_Toolkit-#140-PushingNodesWithConstraintsTriggersIssue

Conversation

@Arne-Martensen
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

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

@bhombot-ci
Copy link
Copy Markdown

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
Copy Markdown
Contributor Author

@BHoMBot check versioning

@bhombot-ci
Copy link
Copy Markdown

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
Copy Markdown
Contributor Author

@BHoMBot check versioning

@bhombot-ci
Copy link
Copy Markdown

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
Copy Markdown
Contributor

@BHoMBot check versioning

@bhombot-ci
Copy link
Copy Markdown

bhombot-ci Bot commented Mar 5, 2026

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

  • check versioning

Copy link
Copy Markdown

@HugoVanLooveren HugoVanLooveren left a comment

Choose a reason for hiding this comment

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

Checked with several cases - all now seem to work. - approved!
An improvement for future use would be that we don't get double pushed supports - if the comparer can somehow know whether node 1 or 2 is the newest the support can be overwritten. I guess that has to be worked out in another file.

@Arne-Martensen
Copy link
Copy Markdown
Contributor Author

@BHoMBot check ready-to-merge

@bhombot-ci
Copy link
Copy Markdown

bhombot-ci Bot commented Mar 6, 2026

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

  • check ready-to-merge

@peterjamesnugent peterjamesnugent merged commit 496335b into develop Mar 6, 2026
12 checks passed
@peterjamesnugent peterjamesnugent deleted the RFEM6_Toolkit-#140-PushingNodesWithConstraintsTriggersIssue branch March 6, 2026 09:05
@HugoVanLooveren HugoVanLooveren restored the RFEM6_Toolkit-#140-PushingNodesWithConstraintsTriggersIssue branch March 6, 2026 12:24
@BHoMBot BHoMBot mentioned this pull request Mar 23, 2026
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

4 participants