dotnet/reactive · error · ArgumentNullException

thirteenth

Error message

thirteenth

What it means

ArgumentNullException with parameter name 'thirteenth' thrown at QbservableEx.Homoicon.cs:2196 by the Zip argument-validation chain in QbservableEx. A 13+-ary Zip call received a null thirteenth IQbservable source; Rx.NET throws eagerly before composing the query, naming the offending parameter.

Solutions

  1. Pass a valid non-null thirteenth sequence.
  2. Remove the dead slot and use the lower-arity overload; for very wide zips, chain pairwise Zips instead.
  3. Fix the source collection/provider so every slot is populated.
  4. Validate the source array (non-null, expected length) before the Zip call.

Example fix

// before
var zipped = QbservableEx.Zip(q1, ..., q13, selector); // q13 null after removal
// after
// remove the deprecated source and switch to the 12-arg overload
var zipped = QbservableEx.Zip(q1, q2, q3, q4, q5, q6, q7, q8, q9, q10, q11, q12, selector);
Defensive patterns

Strategy: validation

Validate before calling

if (sources is { Length: 13 } && sources.Any(s => s is null))
    throw new InvalidOperationException("Zip source list contains null");

Type guard

bool ThirteenValid<TSource>(IQbservable<TSource>?[] xs) => xs.Length == 13 && xs.All(x => x is not null);

Try / catch

try { /* zip call */ }
catch (ArgumentNullException ex) when (ex.ParamName == "thirteenth")
{
    logger.LogError(ex, "Removed/deprecated stream passed as null to Zip");
}

Prevention

When it happens

Trigger: Calling a 13+-ary QbservableEx.Zip with thirteenth == null while the first twelve sources are non-null.

Common situations: Very wide zips assembled from per-tenant or per-device stream collections where one entry is absent; template/codegen producing a fixed arity call with missing sources; migrations where a stream was deprecated and set to null instead of removed.

Related errors


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

Appendix: source

Thrown at Rx.NET/Source/src/System.Reactive/Linq/QbservableEx.Homoicon.cs:2196

                throw new ArgumentNullException(nameof(fourth));
            if (fifth == null)
                throw new ArgumentNullException(nameof(fifth));
            if (sixth == null)
                throw new ArgumentNullException(nameof(sixth));
            if (seventh == null)
                throw new ArgumentNullException(nameof(seventh));
            if (eighth == null)
                throw new ArgumentNullException(nameof(eighth));
            if (ninth == null)
                throw new ArgumentNullException(nameof(ninth));
            if (tenth == null)
                throw new ArgumentNullException(nameof(tenth));
            if (eleventh == null)
                throw new ArgumentNullException(nameof(eleventh));
            if (twelfth == null)
                throw new ArgumentNullException(nameof(twelfth));
            if (thirteenth == null)
                throw new ArgumentNullException(nameof(thirteenth));
            if (fourteenth == null)
                throw new ArgumentNullException(nameof(fourteenth));
            if (fifteenth == null)
                throw new ArgumentNullException(nameof(fifteenth));
            if (sixteenth == null)
                throw new ArgumentNullException(nameof(sixteenth));

            return first.Provider.CreateQuery<(TFirst First, TSecond Second, TThird Third, TFourth Fourth, TFifth Fifth, TSixth Sixth, TSeventh Seventh, TEighth Eighth, TNinth Ninth, TTenth Tenth, TEleventh Eleventh, TTwelfth Twelfth, TThirteenth Thirteenth, TFourteenth Fourteenth, TFifteenth Fifteenth, TSixteenth Sixteenth)>(
                Expression.Call(
                    null,
                    new Func<IQbservable<TFirst>, IObservable<TSecond>, IObservable<TThird>, IObservable<TFourth>, IObservable<TFifth>, IObservable<TSixth>, IObservable<TSeventh>, IObservable<TEighth>, IObservable<TNinth>, IObservable<TTenth>, IObservable<TEleventh>, IObservable<TTwelfth>, IObservable<TThirteenth>, IObservable<TFourteenth>, IObservable<TFifteenth>, IObservable<TSixteenth>, IQbservable<(TFirst First, TSecond Second, TThird Third, TFourth Fourth, TFifth Fifth, TSixth Sixth, TSeventh Seventh, TEighth Eighth, TNinth Ninth, TTenth Tenth, TEleventh Eleventh, TTwelfth Twelfth, TThirteenth Thirteenth, TFourteenth Fourteenth, TFifteenth Fifteenth, TSixteenth Sixteenth)>>(Zip<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh, TEighth, TNinth, TTenth, TEleventh, TTwelfth, TThirteenth, TFourteenth, TFifteenth, TSixteenth>).Method,
                    first.Expression,
                    GetSourceExpression(second),
                    GetSourceExpression(third),
                    GetSourceExpression(fourth),
                    GetSourceExpression(fifth),
                    GetSourceExpression(sixth),
                    GetSourceExpression(seventh),

View on GitHub (pinned to 94b5d5ab91)