{"record":{"id":"d9c95e12622e1601","repo":"dotnet/reactive","slug":"value-cannot-be-null-parameter-fourteenth-observable","errorCode":null,"errorMessage":"Value cannot be null. (Parameter 'fourteenth')","messagePattern":"Value cannot be null\\. \\(Parameter 'fourteenth'\\)","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"Rx.NET/Source/src/System.Reactive/Linq/Observable.Multiple.Zip.cs","lineNumber":1809,"sourceCode":"                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            if (tenth == null)\n                throw new ArgumentNullException(nameof(tenth));\n            if (eleventh == null)\n                throw new ArgumentNullException(nameof(eleventh));\n            if (twelfth == null)\n                throw new ArgumentNullException(nameof(twelfth));\n            if (thirteenth == null)\n                throw new ArgumentNullException(nameof(thirteenth));\n            if (fourteenth == null)\n                throw new ArgumentNullException(nameof(fourteenth));\n            if (fifteenth == null)\n                throw new ArgumentNullException(nameof(fifteenth));\n\n            return s_impl.Zip(first, second, third, fourth, fifth, sixth, seventh, eighth, ninth, tenth, eleventh, twelfth, thirteenth, fourteenth, fifteenth);\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>","sourceCodeStart":1791,"sourceCodeEnd":1827,"githubUrl":"https://github.com/dotnet/reactive/blob/94b5d5ab912789f5abe9a72138a25bbd716fe59c/Rx.NET/Source/src/System.Reactive/Linq/Observable.Multiple.Zip.cs#L1791-L1827","documentation":"System.Reactive validates all fifteen observable source arguments of this Zip overload before constructing the query. A null fourteenth sequence trips the guard at Observable.Multiple.Zip.cs:1809, throwing ArgumentNullException with Parameter 'fourteenth'. The throw happens synchronously at call time so invalid compositions never reach subscription.","triggerScenarios":"Calling the public static Observable.Zip overload for up to fifteen IObservable<T> sources with null in the fourteenth argument position, i.e. immediately before the terminating s_impl.Zip(first, ..., fifteenth) call.","commonSituations":"A feed service returning null when unavailable; positional args to a 15-source zip where one source was conditionally created; hand-unrolled code from a dynamic sources list with fewer than 15 entries.","solutions":["Supply a non-null IObservable<T> for the fourteenth source; use Observable.Empty<TFourteenth>() when absent by design.","Validate/coalesce every source argument before calling Zip.","Fix the upstream initialization that produced the null fourteenth stream.","Prefer the IEnumerable overload of Zip for a dynamic number of sources.","Catch ArgumentNullException around the composition to convert it into a domain error."],"exampleFix":"// before\nvar q = s1.Zip(s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15); // s14 == null\n// after\nif (s14 is null) s14 = Observable.Empty<T14>();\nvar q = s1.Zip(s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15);","handlingStrategy":"validation","validationCode":"if (s14 is null) s14 = Observable.Empty<T14>();","typeGuard":"static IObservable<T> NonNull<T>(IObservable<T>? s, [CallerArgumentExpression(nameof(s))] string? name = null) => s ?? throw new ArgumentNullException(name);","tryCatchPattern":"try { q = s1.Zip(..., s15); }\ncatch (ArgumentNullException ex) when (ex.ParamName == \"fourteenth\") { q = Fallback(); }","preventionTips":["Coalesce optional streams at the point they are obtained, not at the Zip call.","Ensure services that provide streams never return null (return empty observables).","Prefer collection-based Zip for more than a handful of sources.","Add composition-time validation in a shared helper method."],"tags":["csharp","rx","null-argument","zip","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"}