{"record":{"id":"ff7d18de351f696f","repo":"dotnet/reactive","slug":"value-cannot-be-null-parameter-fourth-qbservableex-homoicon","errorCode":null,"errorMessage":"Value cannot be null. (Parameter 'fourth')","messagePattern":"Value cannot be null\\. \\(Parameter 'fourth'\\)","errorType":"validation","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"Rx.NET/Source/src/System.Reactive/Linq/QbservableEx.Homoicon.cs","lineNumber":413,"sourceCode":"        /// <param name=\"fifth\">Fifth observable source.</param>\n        /// <param name=\"sixth\">Sixth observable source.</param>\n        /// <param name=\"seventh\">Seventh observable source.</param>\n        /// <param name=\"eighth\">Eighth observable source.</param>\n        /// <param name=\"ninth\">Ninth observable source.</param>\n        /// <param name=\"tenth\">Tenth observable source.</param>\n        /// <returns>An observable sequence containing the result of combining elements of the sources using tuple values.</returns>\n        /// <exception cref=\"ArgumentNullException\">\n        /// <paramref name=\"first\" /> or <paramref name=\"second\" /> or <paramref name=\"third\" /> or <paramref name=\"fourth\" /> or <paramref name=\"fifth\" /> or <paramref name=\"sixth\" /> or <paramref name=\"seventh\" /> or <paramref name=\"eighth\" /> or <paramref name=\"ninth\" /> or <paramref name=\"tenth\" /> is null.</exception>\n        public static 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>(this IQbservable<TFirst> first, IObservable<TSecond> second, IObservable<TThird> third, IObservable<TFourth> fourth, IObservable<TFifth> fifth, IObservable<TSixth> sixth, IObservable<TSeventh> seventh, IObservable<TEighth> eighth, IObservable<TNinth> ninth, IObservable<TTenth> tenth)\n        {\n            if (first == null)\n                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,","sourceCodeStart":395,"sourceCodeEnd":431,"githubUrl":"https://github.com/dotnet/reactive/blob/94b5d5ab912789f5abe9a72138a25bbd716fe59c/Rx.NET/Source/src/System.Reactive/Linq/QbservableEx.Homoicon.cs#L395-L431","documentation":"ArgumentNullException with message \"Value cannot be null. (Parameter 'fourth')\" is thrown by the 10-source CombineLatest overload when the fourth source sequence is null. Like all Rx operators, CombineLatest requires non-null source sequences; the guard at QbservableEx.Homoicon.cs:413-414 runs before the query expression tree is created via first.Provider.CreateQuery.","triggerScenarios":"Calling QbservableEx.CombineLatest with the fourth argument (IObservable<TFourth>) set to null; the check executes after the first three sources validate successfully.","commonSituations":"A pipeline built dynamically where the fourth stream's creation step was skipped or failed silently; null returned from a conditional stream builder; uninitialized class members holding the sources.","solutions":["Supply a valid IObservable<TFourth> instance; substitute Observable.Empty<TFourth>() or Observable.Never<TFourth>() when no stream is available.","Trace and fix the code path that assigns null to the fourth source (failed factory, missing DI registration).","Restructure the call to a lower-arity CombineLatest overload if the fourth source is optional."],"exampleFix":"// before\nvar combined = first.CombineLatest(second, third, fourth, fifth, sixth, seventh, eighth, ninth, tenth);\n// after\nvar combined = first.CombineLatest(second, third, fourth ?? Observable.Empty<TFourth>(), fifth, sixth, seventh, eighth, ninth, tenth);","handlingStrategy":"validation","validationCode":"if (fourth is null) throw new InvalidOperationException(\"fourth source must be a non-null IObservable<TFourth>\");\n// or: fourth ??= Observable.Empty<TFourth>();","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 == \"fourth\")\n{\n    // handle missing fourth source\n}","preventionTips":["Audit pipeline builders so skipped/failed stream creation yields Empty, not null.","Coalesce with ?? Observable.Empty<T>() at the call site.","Use nullable reference type annotations to surface possible nulls at compile time."],"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"}