{"record":{"id":"519f4d8a35877813","repo":"dotnet/reactive","slug":"throw-new-argumentnullexception-nameof-twelfth","errorCode":null,"errorMessage":"throw new ArgumentNullException(nameof(twelfth))","messagePattern":"throw new ArgumentNullException\\(nameof\\(twelfth\\)\\)","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"Rx.NET/Source/src/System.Reactive/Linq/QbservableEx.Homoicon.cs","lineNumber":918,"sourceCode":"                throw new ArgumentNullException(nameof(third));\n            if (fourth == null)\n                throw new ArgumentNullException(nameof(fourth));\n            if (fifth == null)\n                throw new ArgumentNullException(nameof(fifth));\n            if (sixth == null)\n                throw new ArgumentNullException(nameof(sixth));\n            if (seventh == null)\n                throw new ArgumentNullException(nameof(seventh));\n            if (eighth == null)\n                throw new ArgumentNullException(nameof(eighth));\n            if (ninth == null)\n                throw new ArgumentNullException(nameof(ninth));\n            if (tenth == null)\n                throw new ArgumentNullException(nameof(tenth));\n            if (eleventh == null)\n                throw new ArgumentNullException(nameof(eleventh));\n            if (twelfth == null)\n                throw new ArgumentNullException(nameof(twelfth));\n            if (thirteenth == null)\n                throw new ArgumentNullException(nameof(thirteenth));\n            if (fourteenth == null)\n                throw new ArgumentNullException(nameof(fourteenth));\n            if (fifteenth == null)\n                throw new ArgumentNullException(nameof(fifteenth));\n            if (sixteenth == null)\n                throw new ArgumentNullException(nameof(sixteenth));\n\n            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)>(\n                Expression.Call(\n                    null,\n                    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,\n                    first.Expression,\n                    GetSourceExpression(second),\n                    GetSourceExpression(third),\n                    GetSourceExpression(fourth),\n                    GetSourceExpression(fifth),","sourceCodeStart":900,"sourceCodeEnd":936,"githubUrl":"https://github.com/dotnet/reactive/blob/94b5d5ab912789f5abe9a72138a25bbd716fe59c/Rx.NET/Source/src/System.Reactive/Linq/QbservableEx.Homoicon.cs#L900-L936","documentation":"System.ArgumentNullException raised by the null-guard for the twelfth source in a CombineLatest overload in QbservableEx.Homoicon.cs. Because IQbservable operators run remotely through providers, null sources cannot be encoded, so every source is null-checked before expression construction.","triggerScenarios":"Invoking the 12+ argument Qbservable.CombineLatest overload with twelfth == null at line 918 of the guard chain.","commonSituations":"Twelfth stream of a 16-source dashboard query is produced by a plugin that failed to load; long argument list miscount leaving slot 12 empty.","solutions":["Ensure the twelfth argument is an instantiated IQbservable.","Substitute an empty/default stream when optional.","Fix plugin/factory initialization that should produce the twelfth stream.","Consider combining sources in stages to reduce arity and risk of slot errors."],"exampleFix":"// before\nCombineLatest(s1,...,s11, twelfth, sel); // twelfth == null\n// after\ntwelfth ??= provider.CreateQuery<T12>(Expression.Constant(Observable.Empty<T12>()));\nCombineLatest(s1,...,s11, twelfth, sel);","handlingStrategy":"validation","validationCode":"if (s12 == null) s12 = provider.CreateQuery<T12>(Expression.Constant(Observable.Empty<T12>()));","typeGuard":"static bool IsNonNullSource<T>(IQbservable<T> s) => s != null;","tryCatchPattern":"try { CombineLatest(..., s12, ...); } catch (ArgumentNullException ex) when (ex.ParamName == \"twelfth\") { /* rebuild with placeholder stream */ }","preventionTips":["Confirm plugins producing streams loaded before query build","Default missing registry entries to empty streams","Avoid null placeholders in 12+ argument calls","Track stream provisioning with initialization flags"],"tags":["argumentnull","qbservable","combinelatest"],"backgroundTag":"null-argument","analyzedSha":"94b5d5ab912789f5abe9a72138a25bbd716fe59c","analyzedAt":"2026-09-15T02:26:24.759Z","contentChangedAt":"2026-09-15T02:26:24.759Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}