{"record":{"id":"6f1c0e1bb2001b22","repo":"dotnet/reactive","slug":"source15","errorCode":null,"errorMessage":"source15","messagePattern":"source15","errorType":"validation","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"Rx.NET/Source/src/System.Reactive/Linq/Observable.Multiple.Zip.cs","lineNumber":1040,"sourceCode":"\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 (source14 == null)\n            {\n                throw new ArgumentNullException(nameof(source14));\n            }\n\n            if (source15 == null)\n            {\n                throw new ArgumentNullException(nameof(source15));\n            }\n\n            if (resultSelector == null)\n            {\n                throw new ArgumentNullException(nameof(resultSelector));\n            }\n\n            return s_impl.Zip(source1, source2, source3, source4, source5, source6, source7, source8, source9, source10, source11, source12, source13, source14, source15, resultSelector);\n        }\n\n        /// <summary>\n        /// Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index.\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":1022,"sourceCodeEnd":1058,"githubUrl":"https://github.com/dotnet/reactive/blob/94b5d5ab912789f5abe9a72138a25bbd716fe59c/Rx.NET/Source/src/System.Reactive/Linq/Observable.Multiple.Zip.cs#L1022-L1058","documentation":"This ArgumentNullException is thrown synchronously by the public Zip extension method when the fifteenth source observable (source15) is null. Rx operators validate all arguments up front before subscribing, so a null source is rejected immediately rather than surfacing later as a NullReferenceException inside the query. The 15-source overload requires every input sequence to be a non-null IObservable<T>.","triggerScenarios":"Calling Observable.Zip(source1..source14, null, resultSelector) - i.e. the 15-argument overload of Zip with source15 passed as null while all other arguments are non-null. The check executes synchronously at the Zip call site (Observable.Multiple.Zip.cs:1040).","commonSituations":"Building zip chains programmatically where one entry in a source array/collection is null; refactoring from a 14-source Zip to 15 sources and forgetting to wire the new source; a factory or DI method returning null instead of an empty observable; LINQ query syntax where an intermediate expression evaluates to null.","solutions":["Ensure source15 is assigned a valid IObservable<TSource15> instance before calling Zip","If 'no data' is intended, pass Observable.Empty<TSource15>() instead of null","Guard the call site with a null check and throw a meaningful application-level error or use a default source","If sources come from a collection, filter or validate entries with a null check before zipping"],"exampleFix":"// before\nvar zipped = Observable.Zip(s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, null, (a, b) => a + b);\n// after\nIObservable<int> s15 = GetFifteenthSource() ?? Observable.Empty<int>();\nvar zipped = Observable.Zip(s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, (a, b) => a + b);","handlingStrategy":"validation","validationCode":"if (source15 == null)\n{\n    source15 = Observable.Empty<TSource15>(); // or throw a domain-specific error\n}\nvar zipped = Observable.Zip(s1, ..., source15, resultSelector);","typeGuard":"static bool IsValidSource<TSource15>(IObservable<TSource15> s) => s is not null;","tryCatchPattern":"try\n{\n    var zipped = Observable.Zip(s1, ..., s15, selector);\n    return zipped;\n}\ncatch (ArgumentNullException ex) when (ex.ParamName == nameof(source15))\n{\n    // log which source was null and fall back to an empty/alternate pipeline\n    return Observable.Empty<TResult>();\n}","preventionTips":["Never represent 'no stream' as null; use Observable.Empty<T>","Have stream factories return non-null observables unconditionally","Null-check or assert all sources before composing long Zip chains","Prefer combining sources from a collection with a null filter before zipping"],"tags":["rx","null-argument","argument-validation","zip","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"}