{"record":{"id":"d996fc6c8600a255","repo":"dotnet/reactive","slug":"value-cannot-be-null-parameter-third-qbservableex-homoicon","errorCode":null,"errorMessage":"Value cannot be null. (Parameter 'third')","messagePattern":"Value cannot be null\\. \\(Parameter 'third'\\)","errorType":"validation","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"Rx.NET/Source/src/System.Reactive/Linq/QbservableEx.Homoicon.cs","lineNumber":411,"sourceCode":"        /// <param name=\"third\">Third observable source.</param>\n        /// <param name=\"fourth\">Fourth observable source.</param>\n        /// <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,","sourceCodeStart":393,"sourceCodeEnd":429,"githubUrl":"https://github.com/dotnet/reactive/blob/94b5d5ab912789f5abe9a72138a25bbd716fe59c/Rx.NET/Source/src/System.Reactive/Linq/QbservableEx.Homoicon.cs#L393-L429","documentation":"ArgumentNullException with message \"Value cannot be null. (Parameter 'third')\" is thrown by the 10-source CombineLatest overload when the third source sequence is null. The method validates each of the ten source arguments before constructing the query expression, since a null argument cannot be embedded in the Expression.Call tree sent to the IQbservableProvider.","triggerScenarios":"Calling QbservableEx.CombineLatest(first, second, third, ..., tenth) with third == null; the guard at QbservableEx.Homoicon.cs:411-412 fires after first and second pass validation.","commonSituations":"Merging sensor/event streams where one stream factory returned null; nullable IObservable fields from incomplete initialization; calling code paths where an optional third stream is passed as null instead of Observable.Empty.","solutions":["Pass a non-null IObservable<TThird>; if the stream is legitimately absent, use Observable.Empty<TThird>() or a Never sequence.","Fix the producer of the third stream so it never returns null (throw or return Empty instead).","Drop the third argument and use a 9-argument CombineLatest overload if the source is truly optional."],"exampleFix":"// before\nvar combined = first.CombineLatest(second, third, fourth, fifth, sixth, seventh, eighth, ninth, tenth);\n// after\nvar combined = first.CombineLatest(second, third ?? Observable.Empty<TThird>(), fourth, fifth, sixth, seventh, eighth, ninth, tenth);","handlingStrategy":"validation","validationCode":"if (third is null) throw new InvalidOperationException(\"third source must be a non-null IObservable<TThird>\");\n// or: third ??= Observable.Empty<TThird>();","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 == \"third\")\n{\n    // handle missing third source\n}","preventionTips":["Replace null-returning stream factories with ones that return Observable.Empty or Observable.Throw.","Coalesce optional sources with ?? Observable.Empty<T>().","Prefer lower-arity CombineLatest overloads when a source is genuinely optional."],"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"}