Rfem6 toolkit #140 pushing nodes with constraints triggers issue#141
Conversation
…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 to confirm, the following actions are now queued:
|
|
@BHoMBot check versioning |
|
@Arne-Martensen to confirm, the following actions are now queued:
There are 1 requests in the queue ahead of you. |
|
@BHoMBot check versioning |
|
@Arne-Martensen to confirm, the following actions are now queued:
There are 1 requests in the queue ahead of you. |
|
@BHoMBot check versioning |
|
@michaelhoehn to confirm, the following actions are now queued:
|
HugoVanLooveren
left a comment
There was a problem hiding this comment.
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.
|
@BHoMBot check ready-to-merge |
|
@Arne-Martensen to confirm, the following actions are now queued:
|
Issues addressed by this PR
Closes #140
Fix
NullReferenceExceptioninRFEMNodalComparer.Equals()when pushing nodes without constraints to RFEM.Test files
Changelog
RFEMNodalComparerto handle nodes withnullsupports without throwingNodeDistanceComparerastatic readonlyfield, simplified null checks, removed redundantEquals()callAdditional comments
The root cause was that
RFEMNodalComparer.Equals()did not account forNode.Supportbeingnull. While the null checks existed, a case-sensitivity typo on the field name (_nodecompvs_nodeComp) prevented compilation, and the duplicatenodecomp.Equals()call at the end of the method was unnecessary. Took the opportunity to clean up the overall implementation.