Fix LWWDictionary.Delta ArgumentNullException when underlying delta is null#7911
Merged
Arkatufus merged 1 commit intoOct 16, 2025
Merged
Conversation
…s null (akkadotnet#7910) ## Summary Fixed a bug where LWWDictionary.Delta would throw ArgumentNullException when the underlying ORDictionary.Delta is null, which is a legitimate state after initialization or calling ResetDelta(). ## Changes - Modified LWWDictionary.Delta property to return null when Underlying.Delta is null - Added test Bugfix_7910_LWWDictionary_Delta_should_handle_null_underlying_delta to verify the fix ## Root Cause The LWWDictionary.Delta property was unconditionally wrapping Underlying.Delta in a LWWDictionaryDelta constructor, which throws ArgumentNullException when passed null. However, ORDictionary.Delta can legitimately return null after construction or ResetDelta(). The Replicator expects deltas to be nullable (uses ?? operator at lines 665 and 685), so this fix aligns LWWDictionary with the expected interface contract. Fixes akkadotnet#7910
Aaronontheweb
added a commit
to Aaronontheweb/akka.net
that referenced
this pull request
Oct 16, 2025
…s null (akkadotnet#7910) (akkadotnet#7911) ## Summary Fixed a bug where LWWDictionary.Delta would throw ArgumentNullException when the underlying ORDictionary.Delta is null, which is a legitimate state after initialization or calling ResetDelta(). ## Changes - Modified LWWDictionary.Delta property to return null when Underlying.Delta is null - Added test Bugfix_7910_LWWDictionary_Delta_should_handle_null_underlying_delta to verify the fix ## Root Cause The LWWDictionary.Delta property was unconditionally wrapping Underlying.Delta in a LWWDictionaryDelta constructor, which throws ArgumentNullException when passed null. However, ORDictionary.Delta can legitimately return null after construction or ResetDelta(). The Replicator expects deltas to be nullable (uses ?? operator at lines 665 and 685), so this fix aligns LWWDictionary with the expected interface contract. Fixes akkadotnet#7910
Aaronontheweb
added a commit
that referenced
this pull request
Oct 16, 2025
…s null (#7910) (#7911) (#7912) ## Summary Fixed a bug where LWWDictionary.Delta would throw ArgumentNullException when the underlying ORDictionary.Delta is null, which is a legitimate state after initialization or calling ResetDelta(). ## Changes - Modified LWWDictionary.Delta property to return null when Underlying.Delta is null - Added test Bugfix_7910_LWWDictionary_Delta_should_handle_null_underlying_delta to verify the fix ## Root Cause The LWWDictionary.Delta property was unconditionally wrapping Underlying.Delta in a LWWDictionaryDelta constructor, which throws ArgumentNullException when passed null. However, ORDictionary.Delta can legitimately return null after construction or ResetDelta(). The Replicator expects deltas to be nullable (uses ?? operator at lines 665 and 685), so this fix aligns LWWDictionary with the expected interface contract. Fixes #7910
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixed a bug where
LWWDictionary.Deltawould throwArgumentNullExceptionwhen the underlyingORDictionary.Deltaisnull, which is a legitimate state after initialization or callingResetDelta().Changes
LWWDictionary.Deltaproperty to returnnullwhenUnderlying.DeltaisnullBugfix_7910_LWWDictionary_Delta_should_handle_null_underlying_deltato verify the fixRoot Cause
The
LWWDictionary.Deltaproperty was unconditionally wrappingUnderlying.Deltain aLWWDictionaryDeltaconstructor, which throwsArgumentNullExceptionwhen passednull. However,ORDictionary.Deltacan legitimately returnnullafter construction orResetDelta().The Replicator expects deltas to be nullable (uses
??operator at lines 665 and 685 inReplicator.cs), so this fix alignsLWWDictionarywith the expected interface contract.Test Evidence
All 6
LWWDictionarySpectests pass:Fixes #7910