{"record":{"id":"5b946ac00d3c9a51","repo":"dotnet/reactive","slug":"value-cannot-be-null-parameter-second-qbservableex-homoicon","errorCode":null,"errorMessage":"Value cannot be null. (Parameter 'second')","messagePattern":"Value cannot be null\\. \\(Parameter 'second'\\)","errorType":"validation","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"Rx.NET/Source/src/System.Reactive/Linq/QbservableEx.Homoicon.cs","lineNumber":478,"sourceCode":"        /// <param name=\"second\">Second observable source.</param>\n        /// <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        /// <param name=\"eleventh\">Eleventh 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\" /> or <paramref name=\"eleventh\" /> 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, TEleventh Eleventh)> CombineLatest<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh, TEighth, TNinth, TTenth, TEleventh>(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, IObservable<TEleventh> eleventh)\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            if (eleventh == null)\n                throw new ArgumentNullException(nameof(eleventh));","sourceCodeStart":460,"sourceCodeEnd":496,"githubUrl":"https://github.com/dotnet/reactive/blob/94b5d5ab912789f5abe9a72138a25bbd716fe59c/Rx.NET/Source/src/System.Reactive/Linq/QbservableEx.Homoicon.cs#L460-L496","documentation":"This overload validates all 11 source sequences up front; a null 'second' makes it impossible to reference that source in the expression tree passed to the provider. The library throws ArgumentNullException immediately at composition time. Fix by supplying a real IObservable<TSecond>.","triggerScenarios":"Calling CombineLatest where the second argument (first IObservable<TSecond> non-IQbservable parameter) is null, e.g. null result from a service call that should return an observable.","commonSituations":"A repository or service method returning IObservable<T> returning null on a miss, uninitialized dependency injection field, or conditional wiring that skipped creating the source.","solutions":["Verify the second argument is a concrete observable (Subject, Observable.Return, FromEventPattern, etc.) not null","If the source may be absent, substitute Observable.Empty<TSecond>()","Add a Debug.Assert or guard before composing the query"],"exampleFix":"// before\nIObservable<string> second = null;\nvar q = first.CombineLatest(second, third, ...);\n// after\nIObservable<string> second = Observable.Empty<string>();\nvar q = first.CombineLatest(second, third, ...);","handlingStrategy":"validation","validationCode":"if (first == null || second == null) throw new ArgumentNullException(nameof(second));","typeGuard":"static bool IsObservableSet(params IObservable<object>[] sources) => sources.All(s => s is not null);","tryCatchPattern":"try { var q = first.CombineLatest(second, ...); }\ncatch (ArgumentNullException ex) when (ex.ParamName == \"second\") { /* construct second before combining */ }","preventionTips":["Return Observable.Empty<T>() instead of null from stream factories","Wire all sources before composing queries","Use nullable reference types to surface null flows at compile time"],"tags":["null-reference","argument-validation","rx","qbservable"],"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"}