{"record":{"id":"6611b52ec518d90a","repo":"dotnet/reactive","slug":"value-cannot-be-null-parameter-source13-observable-multiple","errorCode":null,"errorMessage":"Value cannot be null. (Parameter 'source13')","messagePattern":"Value cannot be null\\. \\(Parameter 'source13'\\)","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"Rx.NET/Source/src/System.Reactive/Linq/Observable.Multiple.CombineLatest.cs","lineNumber":814,"sourceCode":"\n            if (source10 == null)\n            {\n                throw new ArgumentNullException(nameof(source10));\n            }\n\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 (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, 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":796,"sourceCodeEnd":832,"githubUrl":"https://github.com/dotnet/reactive/blob/94b5d5ab912789f5abe9a72138a25bbd716fe59c/Rx.NET/Source/src/System.Reactive/Linq/Observable.Multiple.CombineLatest.cs#L796-L832","documentation":"The 13-source Observable.CombineLatest overload null-checks all 13 sources and then the resultSelector; this error means the thirteenth source (source13) was null. The last source is validated before the selector so the null-check order matches parameter order.","triggerScenarios":"Calling Observable.CombineLatest with 13 sources where the final source argument is null, triggering the guard at Observable.Multiple.CombineLatest.cs:814.","commonSituations":"The last stream (often a completion/trigger signal) never assigned; copy-paste of the call missing the final source; a nullable subject that was disposed and set to null.","solutions":["Ensure the thirteenth argument is a non-null IObservable<TSource13> before the call.","Substitute Observable.Empty<TSource13>() if the final signal is optional (CombineLatest then completes when others finish).","Hold Subjects/streams in non-null fields initialized at construction instead of null-then-assign."],"exampleFix":"// before\nObservable.CombineLatest(s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, trigger, sel); // trigger null\n// after\nvar s13 = trigger ?? Observable.Empty<T13>();\nObservable.CombineLatest(s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, sel);","handlingStrategy":"validation","validationCode":"if (source13 == null) throw new InvalidOperationException(\"source13 must be assigned before CombineLatest\");","typeGuard":"bool IsValidSource13<T13>(IObservable<T13> s) => s is not null;","tryCatchPattern":"try { combined = Observable.CombineLatest(s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, sel); }\ncatch (ArgumentNullException ex) when (ex.ParamName == \"source13\") { log.LogError(\"source13 was null\"); combined = Observable.Empty<TResult>(); }","preventionTips":["Assign trigger/completion streams before combining","Never set Subjects to null after disposal; use a completed Subject instead","Copy-paste long calls carefully and verify every positional argument"],"tags":["null-argument","combinelatest","argument-validation","reactive-extensions"],"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"}