{"record":{"id":"c8954e488ed1fb93","repo":"dotnet/reactive","slug":"value-cannot-be-null-parameter-source7-observable-multiple","errorCode":null,"errorMessage":"Value cannot be null. (Parameter 'source7')","messagePattern":"Value cannot be null\\. \\(Parameter 'source7'\\)","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"Rx.NET/Source/src/System.Reactive/Linq/Observable.Multiple.CombineLatest.cs","lineNumber":265,"sourceCode":"\n            if (source4 == null)\n            {\n                throw new ArgumentNullException(nameof(source4));\n            }\n\n            if (source5 == null)\n            {\n                throw new ArgumentNullException(nameof(source5));\n            }\n\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 (resultSelector == null)\n            {\n                throw new ArgumentNullException(nameof(resultSelector));\n            }\n\n            return s_impl.CombineLatest(source1, source2, source3, source4, source5, source6, source7, 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":247,"sourceCodeEnd":283,"githubUrl":"https://github.com/dotnet/reactive/blob/94b5d5ab912789f5abe9a72138a25bbd716fe59c/Rx.NET/Source/src/System.Reactive/Linq/Observable.Multiple.CombineLatest.cs#L247-L283","documentation":"The 7-source CombineLatest overload (Observable.Multiple.CombineLatest.cs:265) throws ArgumentNullException when the seventh source observable is null. This is the last source checked before the resultSelector; CombineLatest subscribes to all seven streams and emits the latest combination whenever any stream produces a value, so every source must be non-null.","triggerScenarios":"Calling the 7-argument Observable.CombineLatest overload with a null seventh observable.","commonSituations":"The trailing stream (often a timer or shutdown signal) not created in some code paths; nullable readonly fields assigned in Initialize() that the query reads before initialization; conditional pipelines skipping the last stream.","solutions":["Ensure the seventh argument is a non-null IObservable<TSource7>.","Default with source7 ?? Observable.Empty<TSource7>().","Move query construction after the point where all streams are guaranteed initialized."],"exampleFix":"// before\nvar combined = Observable.CombineLatest(s1, s2, s3, s4, s5, s6, timer ?? null, sel);\n// after\nvar heartbeat = timer ?? Observable.Never<long>();\nvar combined = Observable.CombineLatest(s1, s2, s3, s4, s5, s6, heartbeat, sel);","handlingStrategy":"validation","validationCode":"if (source7 is null) source7 = Observable.Empty<T7>();","typeGuard":"static bool IsSourceValid<T>(IObservable<T>? s) => s is not null;","tryCatchPattern":"try { var combined = Observable.CombineLatest(s1, s2, s3, s4, s5, s6, s7, sel); }\ncatch (ArgumentNullException ex) when (ex.ParamName == \"source7\") { combined = Observable.CombineLatest(s1, s2, s3, s4, s5, s6, Observable.Empty<T7>(), sel); }","preventionTips":["Initialize trailing streams (timers, signals) in constructors, not lazily.","Delay query construction until all subjects/streams are created.","Coalesce nullable fields at the call site: source7 ?? Observable.Empty<T7>().","Review refactors that reduce stream count; update overloads, don't pass null."],"tags":["null-argument","argument-validation","reactive-extensions","combinelatest"],"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"}