-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Description
Several model classes in the SDK contain Equals methods that may throw NullReferenceException when comparing nullable properties. The current pattern uses:
this.Property == input.Property || this.Property.Equals(input.Property)This will throw if this.Property is null and input.Property is non-null.
Affected Classes
Known affected models:
WriteRequestWrites(OnDuplicate property)WriteRequestDeletes(OnMissing property)
All other model classes with nullable properties should be audited for similar issues.
Proposed Fix
Replace unsafe comparisons with null-safe alternatives:
object.Equals(this.Property, input.Property)Or:
this.Property == input.Property || (this.Property \!= null && this.Property.Equals(input.Property))Context
Identified during review of PR #120.
Referenced by: @rhamzeh
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Type
Projects
Status
Ready