dotnet/reactive · error · ArgumentNullException

throw new ArgumentNullException(nameof(fourteenth))

Error message

throw new ArgumentNullException(nameof(fourteenth))

What it means

System.ArgumentNullException raised by the null-guard for the fourteenth source in a CombineLatest overload in QbservableEx.Homoicon.cs. The overload's validation chain rejected the call because the fourteenth source was null; the CreateQuery expression tree was never built.

Solutions

  1. Provide a valid fourteenth IQbservable argument.
  2. Fill absent optional streams with empty default sources.
  3. Verify initialization of the component producing the fourteenth stream.
  4. Refactor to staged CombineLatest calls (e.g. combine in groups of 4) for maintainability.

Example fix

// before
CombineLatest(s1,...,s13, fourteenth, sel); // fourteenth == null
// after
fourteenth ??= provider.CreateQuery<T14>(Expression.Constant(Observable.Empty<T14>()));
CombineLatest(s1,...,s13, fourteenth, sel);
Defensive patterns

Strategy: validation

Validate before calling

if (s14 == null) s14 = provider.CreateQuery<T14>(Expression.Constant(Observable.Empty<T14>()));

Type guard

static bool IsNonNullSource<T>(IQbservable<T> s) => s != null;

Try / catch

try { CombineLatest(..., s14, ...); } catch (ArgumentNullException ex) when (ex.ParamName == "fourteenth") { /* rebuild with fallback fourteenth source */ }

Prevention

When it happens

Trigger: Invoking the 14+ argument Qbservable.CombineLatest overload with fourteenth == null at line 922 of the guard chain.

Common situations: Very large source compositions assembled from conditional lists; one stream dependency missing at runtime (uninitialized service, failed subscription setup).

Related errors


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

Appendix: source

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

                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)>>(CombineLatest<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),
                    GetSourceExpression(eighth),
                    GetSourceExpression(ninth),

View on GitHub (pinned to 94b5d5ab91)