dotnet/reactive · error · ArgumentNullException

tenth

Error message

tenth

What it means

ArgumentNullException with parameter name 'tenth' thrown from the Zip null-validation chain at QbservableEx.Homoicon.cs:2190. The 10+-ary Zip overload requires every source sequence to be non-null; a null tenth argument aborts the call immediately.

Solutions

  1. Supply a valid non-null tenth source sequence.
  2. Use the correct-arity overload for the sources you have.
  3. Fix the cache/factory so it returns a sequence (or an empty one) instead of null.
  4. Add an up-front loop validating every argument with its index.

Example fix

// before
var zipped = QbservableEx.Zip(q1, q2, q3, q4, q5, q6, q7, q8, q9, q10, selector); // q10 null
// after
var q10 = GetTenthSource();
ArgumentNullException.ThrowIfNull(q10);
var zipped = QbservableEx.Zip(q1, q2, q3, q4, q5, q6, q7, q8, q9, q10, selector);
Defensive patterns

Strategy: validation

Validate before calling

var sources = new IQbservable<int>?[] { q1, q2, q3, q4, q5, q6, q7, q8, q9, q10 };
if (sources.Contains(null)) throw new InvalidOperationException("null Zip source");

Type guard

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

Try / catch

try { /* zip call */ }
catch (ArgumentNullException ex) when (ex.ParamName == "tenth")
{
    // substitute a shorter overload or alert
}

Prevention

When it happens

Trigger: Calling a 10+-ary QbservableEx.Zip with tenth == null after first-ninth passed validation.

Common situations: Very large zips built by generators/templates where a slot is skipped; one source obtained from a cache miss returning null; copy-paste edits of long Zip argument lists.

Related errors


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

Appendix: source

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

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

View on GitHub (pinned to 94b5d5ab91)