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
Description
Several model classes in the SDK contain
Equalsmethods that may throwNullReferenceExceptionwhen comparing nullable properties. The current pattern uses:This will throw if
this.Propertyis null andinput.Propertyis 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:
Or:
Context
Identified during review of PR #120.
Referenced by: @rhamzeh