{"record":{"id":"ab53c5a431eebaea","repo":"dotnet/reactive","slug":"value-cannot-be-null-parameter-source9-observable-multiple","errorCode":null,"errorMessage":"Value cannot be null. (Parameter 'source9')","messagePattern":"Value cannot be null\\. \\(Parameter 'source9'\\)","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"Rx.NET/Source/src/System.Reactive/Linq/Observable.Multiple.CombineLatest.cs","lineNumber":420,"sourceCode":"\n            if (source6 == null)\n            {\n                throw new ArgumentNullException(nameof(source6));\n            }\n\n            if (source7 == null)\n            {\n                throw new ArgumentNullException(nameof(source7));\n            }\n\n            if (source8 == null)\n            {\n                throw new ArgumentNullException(nameof(source8));\n            }\n\n            if (source9 == null)\n            {\n                throw new ArgumentNullException(nameof(source9));\n            }\n\n            if (resultSelector == null)\n            {\n                throw new ArgumentNullException(nameof(resultSelector));\n            }\n\n            return s_impl.CombineLatest(source1, source2, source3, source4, source5, source6, source7, source8, source9, resultSelector);\n        }\n\n        /// <summary>\n        /// Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element.\n        /// </summary>\n        /// <typeparam name=\"TSource1\">The type of the elements in the first source sequence.</typeparam>\n        /// <typeparam name=\"TSource2\">The type of the elements in the second source sequence.</typeparam>\n        /// <typeparam name=\"TSource3\">The type of the elements in the third source sequence.</typeparam>\n        /// <typeparam name=\"TSource4\">The type of the elements in the fourth source sequence.</typeparam>\n        /// <typeparam name=\"TSource5\">The type of the elements in the fifth source sequence.</typeparam>","sourceCodeStart":402,"sourceCodeEnd":438,"githubUrl":"https://github.com/dotnet/reactive/blob/94b5d5ab912789f5abe9a72138a25bbd716fe59c/Rx.NET/Source/src/System.Reactive/Linq/Observable.Multiple.CombineLatest.cs#L402-L438","documentation":"The 9-source CombineLatest overload throws ArgumentNullException with Parameter 'source9' when the final (ninth) source observable is null. This is the last source check before the resultSelector check; it fires synchronously at the call site before any subscription occurs.","triggerScenarios":"Passing null as the ninth argument of Observable.CombineLatest — e.g. a stream built from a nullable return value or a dictionary/config miss for the last source.","commonSituations":"The last source is often added later during refactors and its wiring is forgotten; telemetry or signal streams that are null when instrumentation is off.","solutions":["Assign a real IObservable<TSource9> to the ninth argument before the call.","Use Observable.Empty<TSource9>() if the stream can legitimately be absent.","Fix whatever producer returned null for that stream.","Validate all nine sources in one guard method before composition."],"exampleFix":"// before\nvar combined = Observable.CombineLatest(s1, s2, s3, s4, s5, s6, s7, s8, tail, sel); // tail == null\n// after\nvar combined = Observable.CombineLatest(s1, s2, s3, s4, s5, s6, s7, s8, tail ?? Observable.Empty<int>(), sel);","handlingStrategy":"validation","validationCode":"if (tail == null) tail = Observable.Empty<TSource9>();","typeGuard":"bool Ready<T>([NotNullWhen(true)] IObservable<T>? s) => s is not null;","tryCatchPattern":"try { var c = Observable.CombineLatest(s1, s2, s3, s4, s5, s6, s7, s8, s9, sel); }\ncatch (ArgumentNullException ex) when (ex.ParamName == \"source9\") { /* wire the missing stream and retry */ }","preventionTips":["When adding sources during refactors, update all call sites and guards together.","Keep stream construction in a single validated method.","Coalesce late-added sources with Observable.Empty.","Enable nullable reference types."],"tags":["reactive","null-argument","argument-validation","csharp"],"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"}