{"record":{"id":"57b98eca2249967b","repo":"dotnet/reactive","slug":"value-cannot-be-null-parameter-source14-observable-multiple","errorCode":null,"errorMessage":"Value cannot be null. (Parameter 'source14')","messagePattern":"Value cannot be null\\. \\(Parameter 'source14'\\)","errorType":"validation","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"Rx.NET/Source/src/System.Reactive/Linq/Observable.Multiple.CombineLatest.cs","lineNumber":930,"sourceCode":"\n            if (source11 == null)\n            {\n                throw new ArgumentNullException(nameof(source11));\n            }\n\n            if (source12 == null)\n            {\n                throw new ArgumentNullException(nameof(source12));\n            }\n\n            if (source13 == null)\n            {\n                throw new ArgumentNullException(nameof(source13));\n            }\n\n            if (source14 == null)\n            {\n                throw new ArgumentNullException(nameof(source14));\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, source10, source11, source12, source13, source14, 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":912,"sourceCodeEnd":948,"githubUrl":"https://github.com/dotnet/reactive/blob/94b5d5ab912789f5abe9a72138a25bbd716fe59c/Rx.NET/Source/src/System.Reactive/Linq/Observable.Multiple.CombineLatest.cs#L912-L948","documentation":"The CombineLatest overload combining 14 source sequences validates each argument eagerly. When the 14th IObservable<TSource14> argument is null, it throws ArgumentNullException naming 'source14'. Rx's convention is synchronous fail-fast: the exception surfaces at the CombineLatest call itself, not during subscription.","triggerScenarios":"Calling Observable.CombineLatest with 14 sources and passing null as the last source (source14), e.g. from an unassigned variable, a nullable field, or a factory that returned null for the final stream.","commonSituations":"The last argument is easy to miss when a long argument list is edited; adding a 15th argument or trimming an overload call and misplacing a null; a conditional stream that defaulted to null instead of Observable.Empty.","solutions":["Ensure the value passed as source14 is a real, non-null IObservable<TSource14>.","Use Observable.Empty<TSource14>() or a replayed/subject-based default for an optional final stream instead of null.","Validate all sources before the call (e.g. a guarded factory method that throws with a clearer message)."],"exampleFix":"// before\nvar combined = Observable.CombineLatest(s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, finalStream, sel);\n// after\nvar combined = Observable.CombineLatest(s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, finalStream ?? Observable.Empty<Stream14>(), sel);","handlingStrategy":"validation","validationCode":"if (source14 == null) source14 = Observable.Empty<Stream14>();\nvar combined = Observable.CombineLatest(s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, source14, selector);","typeGuard":"bool HasStream<T>(IObservable<T> s) => s is not null;","tryCatchPattern":"try\n{\n    var combined = Observable.CombineLatest(s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, source14, selector);\n}\ncatch (ArgumentNullException ex) when (ex.ParamName == \"source14\")\n{\n    logger.LogError(ex, \"14th CombineLatest source was null\");\n}","preventionTips":["Review the last arguments of long overloads carefully — they are the most commonly missed.","Default optional final streams to Observable.Empty<T>() at the point of acquisition.","Add unit tests that exercise the combination with every stream provided."],"tags":["rx","null-argument","combinelatest","argument-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"}