{"record":{"id":"47c5e9df6e6a8655","repo":"dotnet/reactive","slug":"value-cannot-be-null-parameter-eighth-observable-multiple","errorCode":null,"errorMessage":"Value cannot be null. (Parameter 'eighth')","messagePattern":"Value cannot be null\\. \\(Parameter 'eighth'\\)","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"Rx.NET/Source/src/System.Reactive/Linq/Observable.Multiple.Zip.cs","lineNumber":1398,"sourceCode":"        /// <exception cref=\"ArgumentNullException\"><paramref name=\"first\"/> or <paramref name=\"second\"/> or <paramref name=\"third\"/> or <paramref name=\"fourth\"/> or <paramref name=\"fifth\"/> or <paramref name=\"sixth\"/> or <paramref name=\"seventh\"/> or <paramref name=\"eighth\"/> is null.</exception>\n        public static IObservable<(TFirst First, TSecond Second, TThird Third, TFourth Fourth, TFifth Fifth, TSixth Sixth, TSeventh Seventh, TEighth Eighth)> Zip<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh, TEighth>(this IObservable<TFirst> first, IObservable<TSecond> second, IObservable<TThird> third, IObservable<TFourth> fourth, IObservable<TFifth> fifth, IObservable<TSixth> sixth, IObservable<TSeventh> seventh, IObservable<TEighth> eighth)\n        {\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\n            return s_impl.Zip(first, second, third, fourth, fifth, sixth, seventh, eighth);\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        /// <param name=\"first\">First observable source.</param>\n        /// <param name=\"second\">Second observable source.</param>","sourceCodeStart":1380,"sourceCodeEnd":1416,"githubUrl":"https://github.com/dotnet/reactive/blob/94b5d5ab912789f5abe9a72138a25bbd716fe59c/Rx.NET/Source/src/System.Reactive/Linq/Observable.Multiple.Zip.cs#L1380-L1416","documentation":"The 8-source Zip overload throws ArgumentNullException when the eighth (last) sequence argument is null. Every source passed to Zip must be a valid observable because the operator subscribes to all of them to combine elements pairwise by index. The check is performed synchronously in the public method before returning the zipped sequence.","triggerScenarios":"Calling Observable.Zip(first, second, third, fourth, fifth, sixth, seventh, eighth) with the eighth IObservable<T> argument null — e.g. a truncated argument list from a refactor, or a variable holding the result of a null-returning factory.","commonSituations":"Extending an existing 7-way Zip to 8 sources and forgetting the last one; one stream in a fixed pipeline is conditionally created and was null at runtime; copy-paste left a placeholder unassigned.","solutions":["Supply a valid observable for the eighth argument","If the eighth source is optional, pass Observable.Empty<T>() so Zip completes immediately per its semantics","Fix the factory/lookup that produced null to return a non-null sequence","Add a pre-call validation loop over the sources with named failure messages"],"exampleFix":"// before\nvar zipped = Observable.Zip(s1, s2, s3, s4, s5, s6, s7, last); // last is null\n// after\nvar last = lastStream ?? Observable.Empty<int>();\nvar zipped = Observable.Zip(s1, s2, s3, s4, s5, s6, s7, last);","handlingStrategy":"validation","validationCode":"if (eighth is null) throw new ArgumentNullException(nameof(eighth));\n// or: if (new[] { first, second, third, fourth, fifth, sixth, seventh, eighth }.Any(s => s is null)) throw new InvalidOperationException(\"Zip source is null\");","typeGuard":"static bool IsNonNull<T>(IObservable<T>? s) => s is not null;","tryCatchPattern":"try { var zipped = Observable.Zip(a, b, c, d, e, f, g, h); }\ncatch (ArgumentNullException ex) when (ex.ParamName == \"eighth\") { /* supply Observable.Empty or log */ }","preventionTips":["When extending a Zip to more sources, add the new stream explicitly, never a placeholder","Use Observable.Empty<T>() as the canonical 'absent' source","Turn on nullable reference types and treat IObservable<T>? warnings as errors","Centralize multi-stream composition in one validated helper method"],"tags":["csharp","reactive-extensions","argument-null","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"}