{"record":{"id":"4ab33890c4f683d6","repo":"dotnet/reactive","slug":"value-cannot-be-null-parameter-source13","errorCode":null,"errorMessage":"Value cannot be null. (Parameter 'source13')","messagePattern":"Value cannot be null\\. \\(Parameter 'source13'\\)","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"AsyncRx.NET/System.Reactive.Async/Linq/Operators/Zip.Generated.cs","lineNumber":1533,"sourceCode":"                throw new ArgumentNullException(nameof(source4));\n            if (source5 == null)\n                throw new ArgumentNullException(nameof(source5));\n            if (source6 == null)\n                throw new ArgumentNullException(nameof(source6));\n            if (source7 == null)\n                throw new ArgumentNullException(nameof(source7));\n            if (source8 == null)\n                throw new ArgumentNullException(nameof(source8));\n            if (source9 == null)\n                throw new ArgumentNullException(nameof(source9));\n            if (source10 == null)\n                throw new ArgumentNullException(nameof(source10));\n            if (source11 == null)\n                throw new ArgumentNullException(nameof(source11));\n            if (source12 == null)\n                throw new ArgumentNullException(nameof(source12));\n            if (source13 == null)\n                throw new ArgumentNullException(nameof(source13));\n            if (source14 == null)\n                throw new ArgumentNullException(nameof(source14));\n            if (selector == null)\n                throw new ArgumentNullException(nameof(selector));\n\n            return Create<TResult>(async observer =>\n            {\n                var d = new CompositeAsyncDisposable();\n\n                var (observer1, observer2, observer3, observer4, observer5, observer6, observer7, observer8, observer9, observer10, observer11, observer12, observer13, observer14) = AsyncObserver.Zip(observer, selector);\n\n                var sub1 = source1.SubscribeSafeAsync(observer1).AsTask().ContinueWith(disposable => d.AddAsync(disposable.Result).AsTask()).Unwrap();\n                var sub2 = source2.SubscribeSafeAsync(observer2).AsTask().ContinueWith(disposable => d.AddAsync(disposable.Result).AsTask()).Unwrap();\n                var sub3 = source3.SubscribeSafeAsync(observer3).AsTask().ContinueWith(disposable => d.AddAsync(disposable.Result).AsTask()).Unwrap();\n                var sub4 = source4.SubscribeSafeAsync(observer4).AsTask().ContinueWith(disposable => d.AddAsync(disposable.Result).AsTask()).Unwrap();\n                var sub5 = source5.SubscribeSafeAsync(observer5).AsTask().ContinueWith(disposable => d.AddAsync(disposable.Result).AsTask()).Unwrap();\n                var sub6 = source6.SubscribeSafeAsync(observer6).AsTask().ContinueWith(disposable => d.AddAsync(disposable.Result).AsTask()).Unwrap();\n                var sub7 = source7.SubscribeSafeAsync(observer7).AsTask().ContinueWith(disposable => d.AddAsync(disposable.Result).AsTask()).Unwrap();","sourceCodeStart":1515,"sourceCodeEnd":1551,"githubUrl":"https://github.com/dotnet/reactive/blob/94b5d5ab912789f5abe9a72138a25bbd716fe59c/AsyncRx.NET/System.Reactive.Async/Linq/Operators/Zip.Generated.cs#L1515-L1551","documentation":"This error is thrown by the generated 14-source overload of the Zip extension operator in System.Reactive.Async when the 14th source observable (source13, 0-based 13th) is null. The generated Zip overloads eagerly validate every IAsyncObservable argument and the result selector before creating the operator pipeline, so a null argument fails immediately with ArgumentNullException instead of failing later during subscription.","triggerScenarios":"Calling AsyncObservableExtensions.Zip with 14+ sources where the 14th IAsyncObservable argument is null, e.g. Zip(s1, s2, ..., s13, null, selector) with a Func<...,ValueTask<TResult>> selector. Any of the ten overloads sharing these generated checks behaves identically.","commonSituations":"Passing the result of a lookup or dictionary access that returned null as one of the zipped sources; building the source list programmatically and one element being missing; refactoring from fewer to more zipped sources and misaligning argument positions.","solutions":["Check which Zip overload you are calling and verify every source argument, especially position 14, is non-null before invoking","If a source may legitimately be missing, substitute AsyncObservable.Empty<T>() or a default observable instead of null","Move the call into a guarded helper that validates all sources with a loop before calling Zip","Enable nullable reference types (C# 8 #nullable enable) so the compiler flags a possibly-null source at the call site"],"exampleFix":"// before\nvar result = sources[0].Zip(sources[1], sources[2], sources[3], sources[4], sources[5], sources[6], sources[7], sources[8], sources[9], sources[10], sources[11], sources[12], sources[13], sources[14], selector);\n// after\nvar result = sources[0].Zip(sources[1], sources[2], sources[3], sources[4], sources[5], sources[6], sources[7], sources[8], sources[9], sources[10], sources[11], sources[12], sources[13], sources[14] ?? AsyncObservable.Empty<T14>(), selector);","handlingStrategy":"validation","validationCode":"if (source13 == null) throw new ArgumentException(\"The 14th source passed to Zip must not be null.\");","typeGuard":"static bool IsValidSource<T>(IAsyncObservable<T> source) => source is not null;","tryCatchPattern":"try\n{\n    var zipped = s1.Zip(s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, selector);\n}\ncatch (ArgumentNullException ex) when (ex.ParamName == \"source13\")\n{\n    logger.LogError(ex, \"Zip: 14th source observable was null\");\n}","preventionTips":["Null-check every source before calling the long-ar Zip overloads","Use AsyncObservable.Empty<T>() as the default for optional sources","Enable C# nullable reference types","Never store observables in nullable fields; initialize eagerly"],"tags":["argumentnull","zip-operator","null-check","asyncrx"],"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"}