{"record":{"id":"98717586c7bd8822","repo":"dotnet/reactive","slug":"value-cannot-be-null-parameter-twelfth-qbservableex-homoicon","errorCode":null,"errorMessage":"Value cannot be null. (Parameter 'twelfth')","messagePattern":"Value cannot be null\\. \\(Parameter 'twelfth'\\)","errorType":"validation","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"Rx.NET/Source/src/System.Reactive/Linq/QbservableEx.Homoicon.cs","lineNumber":572,"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\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)>(\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>, 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)>>(CombineLatest<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh, TEighth, TNinth, TTenth, TEleventh, TTwelfth>).Method,\n                    first.Expression,\n                    GetSourceExpression(second),\n                    GetSourceExpression(third),\n                    GetSourceExpression(fourth),\n                    GetSourceExpression(fifth),\n                    GetSourceExpression(sixth),\n                    GetSourceExpression(seventh),\n                    GetSourceExpression(eighth),\n                    GetSourceExpression(ninth),\n                    GetSourceExpression(tenth),\n                    GetSourceExpression(eleventh),\n                    GetSourceExpression(twelfth)\n                )","sourceCodeStart":554,"sourceCodeEnd":590,"githubUrl":"https://github.com/dotnet/reactive/blob/94b5d5ab912789f5abe9a72138a25bbd716fe59c/Rx.NET/Source/src/System.Reactive/Linq/QbservableEx.Homoicon.cs#L554-L590","documentation":"This ArgumentNullException is thrown by the 12-source Qbservable.CombineLatest overload when the twelfth (last) source sequence is null. Like all Qbservable operators, CombineLatest eagerly null-checks every source before constructing the Expression.Call that describes the query, so a null twelfth argument fails immediately at call time. The parameter name in the exception points at the offending argument.","triggerScenarios":"Calling the 12-argument CombineLatest extension (Rx.NET/Source/src/System.Reactive/Linq/QbservableEx.Homoicon.cs:572) with null for the twelfth IObservable<TTwelfth> argument.","commonSituations":"The last source in a long CombineLatest chain is frequently the one forgotten after a signature change or when it comes from an optional service/config that resolved to null.","solutions":["Ensure the twelfth argument is a non-null IObservable<TTwelfth> before the call.","Coalesce to a default sequence such as Observable.Empty<TTwelfth>() when the source is optional.","Fix the producer of the twelfth sequence so it never returns null."],"exampleFix":"// before\nvar query = first.CombineLatest(s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12);\n\n// after\nvar query = first.CombineLatest(s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12 ?? Observable.Empty<TTwelfth>());","handlingStrategy":"validation","validationCode":"if (s12 == null) throw new InvalidOperationException(\"twelfth CombineLatest source is null\"); // or s12 = s12 ?? Observable.Empty<TTwelfth>();","typeGuard":"bool IsValidSource<T>(IObservable<T> s) => s is not null;","tryCatchPattern":"try { var query = first.CombineLatest(..., s12); } catch (ArgumentNullException ex) when (ex.ParamName == \"twelfth\") { /* substitute default source */ }","preventionTips":["Check the last arguments of wide CombineLatest calls after signature changes","Build sources via factory methods that throw meaningful errors instead of returning null","Enable C# nullable reference type analysis"],"tags":["rx","argument-null","observable","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-15T23:17:13.987Z"}