Skip to content

[Bug]: TransformSafeAsync options overload accepts a null legacy factory #1183

Description

@dwcullop

Please note we can't commit to any timeline.

Describe the bug 🐞

The compatibility overload wraps a nullable three-argument transform factory in a non-null cancellation-aware lambda without first validating the original factory. The delegated null check sees the wrapper, so invalid configuration becomes per-item NullReferenceException errors rather than an eager argument error.

Step to reproduce

Pass a typed null Func<Person, Optional, string, Task> to TransformSafeAsync with an error handler and TransformAsyncOptions.Default. Do not subscribe. Repeat with empty and populated source caches.

Regression tests/checks:

OptionsOverload_NullFactory_ThrowsBeforeSubscription

Reproduction repository

https://github.com/reactivemarbles/DynamicData/tree/85ee49cfd54d8782c36ed137886d318e942345c4

Regression tests and fixes:
https://github.com/reactivemarbles/DynamicData/tree/u/dacullop/main/pr-1165-review

Expected behavior

The operator call must immediately throw ArgumentNullException naming transformFactory, before any subscription or item processing.

Screenshots 🖼️

N/A.

IDE

N/A; command-line reproduction.

Operating system

Windows.

Version

.NET SDK 10.0.401; net9.0 test target.

Device

N/A.

DynamicData Version

Main 10.0-preview at 85ee49c. The related 9.5 candidate is PR #1165 at 3d76872.

Additional information ℹ️

Both repository cases fail because no exception is thrown. Restoring the argument checks makes both pass.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions