dotnet/reactive · error · ArgumentNullException

source6

Error message

source6

What it means

The 14-source Zip overload validates source6 at line 878; null causes ArgumentNullException with parameter 'source6'. Zip requires every input stream to subscribe to, so a null sixth sequence is rejected immediately at call time.

Solutions

  1. Pass a real observable (or Observable.Empty<TSource6>()) in position 6.
  2. Fix the null-producing factory or field initialization for source6.
  3. Add pre-call null validation for all 14 sources.
  4. Confirm argument ordering at the call site.

Example fix

// before
var zipped = Observable.Zip(s1, s2, s3, s4, s5, null, s7, ..., s14, selector);
// after
var zipped = Observable.Zip(s1, s2, s3, s4, s5, s6 ?? Observable.Empty<TSource6>(), s7, ..., s14, selector);
Defensive patterns

Strategy: validation

Validate before calling

if (source6 == null) throw new ArgumentNullException(nameof(source6));

Type guard

static IObservable<T> NonNull<T>(IObservable<T> s) => s ?? Observable.Empty<T>();

Try / catch

try { var zipped = Observable.Zip(source1, ..., source6, ...); } catch (ArgumentNullException ex) when (ex.ParamName == "source6") { /* substitute default source or abort */ }

Prevention

When it happens

Trigger: Calling the 14-argument Observable.Zip with null in the sixth argument position while the other 13 sources and the selector are non-null.

Common situations: A null from a per-feed service resolver, an uninitialized field backing the sixth stream, or a reordering bug when editing the very long call signature.

Related errors


AI-assisted analysis of dotnet/reactive@94b5d5ab91 (2026-09-15). Data as JSON: /api/errors/658e18f613a344bf. Report an issue: GitHub.

Appendix: source

Thrown at Rx.NET/Source/src/System.Reactive/Linq/Observable.Multiple.Zip.cs:878

            if (source3 == null)
            {
                throw new ArgumentNullException(nameof(source3));
            }

            if (source4 == null)
            {
                throw new ArgumentNullException(nameof(source4));
            }

            if (source5 == null)
            {
                throw new ArgumentNullException(nameof(source5));
            }

            if (source6 == null)
            {
                throw new ArgumentNullException(nameof(source6));
            }

            if (source7 == null)
            {
                throw new ArgumentNullException(nameof(source7));
            }

            if (source8 == null)
            {
                throw new ArgumentNullException(nameof(source8));
            }

            if (source9 == null)
            {
                throw new ArgumentNullException(nameof(source9));
            }

            if (source10 == null)

View on GitHub (pinned to 94b5d5ab91)