{"record":{"id":"70d1319f4298eeb5","repo":"dotnet/reactive","slug":"value-cannot-be-null-parameter-tenth-qbservableex-homoicon","errorCode":null,"errorMessage":"Value cannot be null. (Parameter 'tenth')","messagePattern":"Value cannot be null\\. \\(Parameter 'tenth'\\)","errorType":"validation","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"Rx.NET/Source/src/System.Reactive/Linq/QbservableEx.Homoicon.cs","lineNumber":425,"sourceCode":"                throw new ArgumentNullException(nameof(first));\n            if (second == null)\n                throw new ArgumentNullException(nameof(second));\n            if (third == null)\n                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\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)>(\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>, IQbservable<(TFirst First, TSecond Second, TThird Third, TFourth Fourth, TFifth Fifth, TSixth Sixth, TSeventh Seventh, TEighth Eighth, TNinth Ninth, TTenth Tenth)>>(CombineLatest<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh, TEighth, TNinth, TTenth>).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                )\n            );\n        }","sourceCodeStart":407,"sourceCodeEnd":443,"githubUrl":"https://github.com/dotnet/reactive/blob/94b5d5ab912789f5abe9a72138a25bbd716fe59c/Rx.NET/Source/src/System.Reactive/Linq/QbservableEx.Homoicon.cs#L407-L443","documentation":"ArgumentNullException with message \"Value cannot be null. (Parameter 'tenth')\" is thrown by the 10-source CombineLatest overload when the tenth source sequence is null. This is the last guard in the validation chain at QbservableEx.Homoicon.cs:425-426; once it passes, the method builds the Expression.Call and delegates to first.Provider.CreateQuery. A null tenth source would make the expression tree invalid, so it is rejected upfront.","triggerScenarios":"Calling QbservableEx.CombineLatest with tenth == null; the guard runs after the first nine sources validate, just before CreateQuery is invoked.","commonSituations":"Multi-stream merges where the final stream depends on optional data that resolved to null; null returned by a conditional stream builder; mis-ordered arguments causing an unintended null slot.","solutions":["Pass a non-null IObservable<TTenth>; coalesce with Observable.Empty<TTenth>() when the stream may be absent.","Verify argument order matches the signature so a non-null stream is not accidentally passed as tenth.","Fix the producer that returns null, or drop the tenth source and use a 9-argument overload."],"exampleFix":"// before\nvar combined = first.CombineLatest(second, third, fourth, fifth, sixth, seventh, eighth, ninth, tenth);\n// after\nvar combined = first.CombineLatest(second, third, fourth, fifth, sixth, seventh, eighth, ninth, tenth ?? Observable.Empty<TTenth>());","handlingStrategy":"validation","validationCode":"if (tenth is null) throw new InvalidOperationException(\"tenth source must be a non-null IObservable<TTenth>\");\n// or: tenth ??= Observable.Empty<TTenth>();","typeGuard":"static bool IsValidSource<T>(IObservable<T>? source) => source is not null;","tryCatchPattern":"try\n{\n    var combined = first.CombineLatest(second, third, fourth, fifth, sixth, seventh, eighth, ninth, tenth);\n}\ncatch (ArgumentNullException ex) when (ex.ParamName == \"tenth\")\n{\n    // handle missing tenth source\n}","preventionTips":["Double-check argument order when calling high-arity overloads; a mis-ordered null is a common cause.","Coalesce optional sources with ?? Observable.Empty<T>().","Favor composing fewer sources (or an array-based pattern) over padding a 10-arity call with nulls."],"tags":["argument-null","reactive-extensions","combinelatest","qbservable","validation"],"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"}