{"record":{"id":"7f381c6bde4db89d","repo":"dotnet/reactive","slug":"value-cannot-be-null-parameter-source3","errorCode":null,"errorMessage":"Value cannot be null. (Parameter 'source3')","messagePattern":"Value cannot be null\\. \\(Parameter 'source3'\\)","errorType":"validation","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"AsyncRx.NET/System.Reactive.Async/Linq/Operators/Zip.Generated.cs","lineNumber":498,"sourceCode":"                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();\n\n                await Task.WhenAll(sub1, sub2, sub3, sub4, sub5, sub6, sub7).ConfigureAwait(false);\n\n                return d;\n            });\n        }\n\n        public static IAsyncObservable<TResult> Zip<T1, T2, T3, T4, T5, T6, T7, TResult>(this IAsyncObservable<T1> source1, IAsyncObservable<T2> source2, IAsyncObservable<T3> source3, IAsyncObservable<T4> source4, IAsyncObservable<T5> source5, IAsyncObservable<T6> source6, IAsyncObservable<T7> source7, Func<T1, T2, T3, T4, T5, T6, T7, TResult> selector)\n        {\n            if (source1 == null)\n                throw new ArgumentNullException(nameof(source1));\n            if (source2 == null)\n                throw new ArgumentNullException(nameof(source2));\n            if (source3 == null)\n                throw new ArgumentNullException(nameof(source3));\n            if (source4 == null)\n                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 (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) = AsyncObserver.Zip(observer, selector);\n\n                var sub1 = source1.SubscribeSafeAsync(observer1).AsTask().ContinueWith(disposable => d.AddAsync(disposable.Result).AsTask()).Unwrap();","sourceCodeStart":480,"sourceCodeEnd":516,"githubUrl":"https://github.com/dotnet/reactive/blob/94b5d5ab912789f5abe9a72138a25bbd716fe59c/AsyncRx.NET/System.Reactive.Async/Linq/Operators/Zip.Generated.cs#L480-L516","documentation":"ArgumentNullException thrown by the generated 7-source Zip operator because source3 (the third IAsyncObservable) is null. Zip pairs elements positionally across all seven sequences, so every source must be a valid observable instance.","triggerScenarios":"Calling s1.Zip(s2, null, s4, s5, s6, s7, selector) with a null third source; also occurs when a dynamically built source list has a gap at index 2.","commonSituations":"Optional third stream not initialized; a data-driven pipeline where one input stream failed to construct; copy-paste of Zip argument lists missing one source.","solutions":["Supply a non-null third observable or AsyncObservable.Empty<T3>() as a placeholder","Check construction of each source in the pipeline for one returning null","Confirm no arguments were skipped/shifted in the 8-argument call"],"exampleFix":"// before\nvar zipped = s1.Zip(s2, s3, s4, s5, s6, s7, sel); // s3 == null\n// after\nvar s3Fixed = s3 ?? AsyncObservable.Empty<T3>();\nvar zipped = s1.Zip(s2, s3Fixed, s4, s5, s6, s7, sel);","handlingStrategy":"validation","validationCode":"if (source3 is null) throw new InvalidOperationException(\"Zip requires all source observables; source3 was null.\");\nif (new[] { s1, s2, s3, s4, s5, s6, s7 }.Any(s => s is null)) throw new InvalidOperationException(\"All Zip sources must be non-null.\");","typeGuard":"bool AllNonNull<T>(params IAsyncObservable<T>?[] sources) => sources.All(s => s is not null);","tryCatchPattern":"try { var zipped = s1.Zip(s2, s3, s4, s5, s6, s7, selector); }\ncatch (ArgumentNullException ex) when (ex.ParamName is \"source1\" or \"source2\" or \"source3\" or \"source4\" or \"source5\" or \"source6\" or \"source7\")\n{\n    throw new InvalidOperationException($\"Zip input missing: {ex.ParamName}\", ex);\n}","preventionTips":["Construct all streams up front and fail fast on any null before zipping","Use AsyncObservable.Empty<T>() as a placeholder for absent streams","When copy-pasting Zip calls, recount the argument list against the arity"],"tags":["argument-null","asyncrx","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"}