{"record":{"id":"8a8e63fe88aef553","repo":"dotnet/reactive","slug":"value-cannot-be-null-parameter-ninth-observable-multiple-zip","errorCode":null,"errorMessage":"Value cannot be null. (Parameter 'ninth')","messagePattern":"Value cannot be null\\. \\(Parameter 'ninth'\\)","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"Rx.NET/Source/src/System.Reactive/Linq/Observable.Multiple.Zip.cs","lineNumber":1445,"sourceCode":"        {\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\n            return s_impl.Zip(first, second, third, fourth, fifth, sixth, seventh, eighth, ninth);\n        }\n\n        /// <summary>\n        /// Merges the specified observable sequences into one observable sequence of tuple values whenever all of the observable sequences have produced an element at a corresponding index.\n        /// </summary>\n        /// <typeparam name=\"TFirst\">The type of the elements in the first source sequence.</typeparam>\n        /// <typeparam name=\"TSecond\">The type of the elements in the second source sequence.</typeparam>\n        /// <typeparam name=\"TThird\">The type of the elements in the third source sequence.</typeparam>\n        /// <typeparam name=\"TFourth\">The type of the elements in the fourth source sequence.</typeparam>\n        /// <typeparam name=\"TFifth\">The type of the elements in the fifth source sequence.</typeparam>\n        /// <typeparam name=\"TSixth\">The type of the elements in the sixth source sequence.</typeparam>\n        /// <typeparam name=\"TSeventh\">The type of the elements in the seventh source sequence.</typeparam>\n        /// <typeparam name=\"TEighth\">The type of the elements in the eighth source sequence.</typeparam>\n        /// <typeparam name=\"TNinth\">The type of the elements in the ninth source sequence.</typeparam>\n        /// <typeparam name=\"TTenth\">The type of the elements in the tenth source sequence.</typeparam>\n        /// <param name=\"first\">First observable source.</param>","sourceCodeStart":1427,"sourceCodeEnd":1463,"githubUrl":"https://github.com/dotnet/reactive/blob/94b5d5ab912789f5abe9a72138a25bbd716fe59c/Rx.NET/Source/src/System.Reactive/Linq/Observable.Multiple.Zip.cs#L1427-L1463","documentation":"The 9-ary Observable.Zip extension throws ArgumentNullException when any source sequence argument is null; 'ninth' identifies the ninth (last) observable as the null one. This eager guard exists so null inputs fail synchronously at the call instead of leaking into the query when subscribed.","triggerScenarios":"Calling Zip(first..ninth) in Observable.Multiple.Zip.cs with ninth == null, e.g. Zip(a, b, c, d, e, f, g, h, null).","commonSituations":"The final source in a long argument list is often supplied by the most recently added code, so it is a frequent refactoring victim; also occurs when a nullable return (FirstOrDefault, TryGet-style) is passed directly as the last argument.","solutions":["Pass a non-null observable for the ninth argument; use Observable.Empty<T>() for an intentionally empty source.","Fix the upstream producer that returned null for the ninth sequence.","Guard the call site: assert all nine arguments non-null before invoking Zip."],"exampleFix":"// before\nvar zipped = Observable.Zip(a, b, c, d, e, f, g, h, maybeNinth); // maybeNinth == null\n// after\nvar ninth = maybeNinth ?? Observable.Empty<TNinth>();\nvar zipped = Observable.Zip(a, b, c, d, e, f, g, h, ninth);","handlingStrategy":"validation","validationCode":"if (ninth == null)\n    throw new InvalidOperationException(\"Zip: ninth source must be non-null; substitute Observable.Empty<TNinth>().\");","typeGuard":"static IObservable<T> OrEmpty<T>(IObservable<T>? source) => source ?? Observable.Empty<T>();","tryCatchPattern":"try { var zipped = Observable.Zip(a, b, c, d, e, f, g, h, i); }\ncatch (ArgumentNullException ex) when (ex.ParamName == \"ninth\") { /* supply Observable.Empty<TNinth>() and retry */ }","preventionTips":["Wrap nullable producers with an OrEmpty helper before composing.","Fix nullable-returning factories so they never yield null streams.","Unit-test compositions with all sources present."],"tags":["rx","null-argument","argument-validation","zip"],"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"}