{"record":{"id":"2fcd4f3f073f058a","repo":"dotnet/reactive","slug":"source14","errorCode":null,"errorMessage":"source14","messagePattern":"source14","errorType":"validation","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"Rx.NET/Source/src/System.Reactive/Linq/Observable.Multiple.Zip.cs","lineNumber":918,"sourceCode":"\n            if (source11 == null)\n            {\n                throw new ArgumentNullException(nameof(source11));\n            }\n\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 (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, 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":900,"sourceCodeEnd":936,"githubUrl":"https://github.com/dotnet/reactive/blob/94b5d5ab912789f5abe9a72138a25bbd716fe59c/Rx.NET/Source/src/System.Reactive/Linq/Observable.Multiple.Zip.cs#L900-L936","documentation":"System.ArgumentNullException thrown by the 14-source public Zip overload in Observable.Multiple.Zip.cs when the last source sequence (source14) is null. Zip validates each of its fourteen source parameters and finally its resultSelector; a null source14 fails that check and the operator never gets created. The eager throw prevents a null reference deeper inside the zipper when it tried to subscribe to the fourteenth sequence.","triggerScenarios":"Calling Observable.Zip(s1, ..., s13, s14, resultSelector) with the fourteenth argument as a null IObservable reference (resultSelector itself non-null, since that check follows).","commonSituations":"A chain of streams extended one item too far where the last stream was never wired (e.g. a background producer that failed to start and left its Subject/observable field null); copy-paste of a Zip call from a 13-source snippet with one extra argument added; null returned by a service that resolves the final stream.","solutions":["Ensure source14 is assigned to a valid observable before calling Zip.","If the last stream is optional, pass Observable.Empty<T>() (note: Zip yields no items if any input is empty, so consider CombineLatest or skipping that source).","Guard with ArgumentNullException.ThrowIfNull(s14) prior to the call for a clearer local failure.","Consolidate sources into an array and use the collection Zip overload, asserting all elements are non-null beforehand."],"exampleFix":"// before\nvar zipped = Observable.Zip(s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, selector); // s14 == null\n// after\nvar zipped = Observable.Zip(s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14 ?? Observable.Empty<bool>(), selector);","handlingStrategy":"validation","validationCode":"if (s14 is null) throw new ArgumentNullException(nameof(s14));","typeGuard":"static bool IsValidSource<T>(IObservable<T>? s) => s is not null;","tryCatchPattern":"try { var zipped = Observable.Zip(s1, ..., s13, s14, selector); } catch (ArgumentNullException ex) when (ex.ParamName == \"source14\") { // use Observable.Empty<T>() or restructure with CombineLatest }","preventionTips":["Verify the last-added stream in a Zip chain is actually started before composition.","Remember Zip emits nothing if any input is empty; design optional streams accordingly.","Run nullable-reference-type analysis in CI to flag uninitialized observable fields.","Prefer fewer, collection-based Zip calls over 14 positional arguments to reduce null-slot mistakes."],"tags":["argumentnull","zip","observables","null-check","system-reactive"],"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"}