dotnet/reactive · error · ArgumentNullException

twelfth

Error message

twelfth

What it means

ArgumentNullException with parameter name 'twelfth' thrown from the Zip null-check block at QbservableEx.Homoicon.cs:2194. The library requires all twelve-plus source sequences of the n-ary Zip overload to be non-null and throws immediately, identifying 'twelfth' as the null parameter.

Solutions

  1. Provide a non-null twelfth sequence.
  2. Use the arity-matched overload or split into smaller Zips (e.g. Zip( Zip(1..6), Zip(7..12) )).
  3. Fix the source-assembly code that leaves the twelfth slot null.
  4. Guard all arguments with a single validation helper before composing.

Example fix

// before
var zipped = QbservableEx.Zip(q1, ..., q12, selector); // q12 null
// after
var q12 = GetTwelfthSource() ?? Observable.Empty<T12>().AsQbservable();
var zipped = QbservableEx.Zip(q1, ..., q12, selector);
Defensive patterns

Strategy: validation

Validate before calling

ArgumentNullException.ThrowIfNull(twelfth);

Type guard

bool TwelfthReady<T12>(IQbservable<T12>? q) => q is not null;

Try / catch

try { /* zip call */ }
catch (ArgumentNullException ex) when (ex.ParamName == "twelfth")
{
    throw new InvalidOperationException("12th Zip source missing after refactor", ex);
}

Prevention

When it happens

Trigger: Calling a 12+-ary QbservableEx.Zip overload with twelfth == null; the first eleven arguments validated successfully.

Common situations: Hand-maintained 12-argument Zip calls after a signature change; sources assembled from a services collection where one element was removed but the Zip call wasn't updated; generated code paths with optional sources.

Related errors


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

Appendix: source

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

                throw new ArgumentNullException(nameof(third));
            if (fourth == null)
                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),

View on GitHub (pinned to 94b5d5ab91)