{"record":{"id":"6780954af2ac5605","repo":"dotnet/reactive","slug":"value-cannot-be-null-parameter-source8","errorCode":null,"errorMessage":"Value cannot be null. (Parameter 'source8')","messagePattern":"Value cannot be null\\. \\(Parameter 'source8'\\)","errorType":"validation","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"AsyncRx.NET/System.Reactive.Async/Linq/Operators/Zip.Generated.cs","lineNumber":586,"sourceCode":"\n        public static IAsyncObservable<(T1, T2, T3, T4, T5, T6, T7, T8)> Zip<T1, T2, T3, T4, T5, T6, T7, T8>(this IAsyncObservable<T1> source1, IAsyncObservable<T2> source2, IAsyncObservable<T3> source3, IAsyncObservable<T4> source4, IAsyncObservable<T5> source5, IAsyncObservable<T6> source6, IAsyncObservable<T7> source7, IAsyncObservable<T8> source8)\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 (source8 == null)\n                throw new ArgumentNullException(nameof(source8));\n\n            return Create<(T1, T2, T3, T4, T5, T6, T7, T8)>(async observer =>\n            {\n                var d = new CompositeAsyncDisposable();\n\n                var (observer1, observer2, observer3, observer4, observer5, observer6, observer7, observer8) = AsyncObserver.Zip(observer);\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();\n                var sub8 = source8.SubscribeSafeAsync(observer8).AsTask().ContinueWith(disposable => d.AddAsync(disposable.Result).AsTask()).Unwrap();\n\n                await Task.WhenAll(sub1, sub2, sub3, sub4, sub5, sub6, sub7, sub8).ConfigureAwait(false);\n","sourceCodeStart":568,"sourceCodeEnd":604,"githubUrl":"https://github.com/dotnet/reactive/blob/94b5d5ab912789f5abe9a72138a25bbd716fe59c/AsyncRx.NET/System.Reactive.Async/Linq/Operators/Zip.Generated.cs#L568-L604","documentation":"AsyncRx.NET's 8-ary Zip operator validates every source before building the observable pipeline. Passing null for the eighth IAsyncObservable source causes an ArgumentNullException with Parameter 'source8'. The library fails fast at call time because a null source would otherwise break subscription logic deep inside AsyncObserver.Zip.","triggerScenarios":"Calling source1.Zip(source2, ..., source8) where the eighth argument is null - e.g. a dictionary lookup, conditional expression, or method returning null was passed as source8.","commonSituations":"Building source lists dynamically (arrays or LINQ projections containing nulls), refactoring code where a source factory started returning null, or optional stream wiring where one of eight inputs was never initialized.","solutions":["Initialize source8 to a valid IAsyncObservable<T8> before calling Zip (e.g. AsyncObservable.Empty<T8>()).","Check the expression producing source8 for accidental null returns (failed lookups, uninitialized fields).","Add a guard or default-substitute (?? AsyncObservable.Empty<T8>()) at the call site.","If sources are in a collection, assert the collection has no null elements before spreading into Zip."],"exampleFix":"// before\nvar zipped = s1.Zip(s2, s3, s4, s5, s6, s7, lookup8, (a,b,c,d,e,f,g,h) => a+h);\n// after\nvar s8 = lookup8 ?? AsyncObservable.Empty<T8>();\nvar zipped = s1.Zip(s2, s3, s4, s5, s6, s7, s8, (a,b,c,d,e,f,g,h) => a+h);","handlingStrategy":"validation","validationCode":"if (source8 == null)\n    throw new InvalidOperationException(\"Zip requires a non-null source8\");\n// or default it: var s8 = maybeSource8 ?? AsyncObservable.Empty<T8>();","typeGuard":"static bool HasSource<T>(IAsyncObservable<T> s) => s is not null;","tryCatchPattern":"try\n{\n    var zipped = s1.Zip(s2, s3, s4, s5, s6, s7, s8, selector);\n}\ncatch (ArgumentNullException ex) when (ex.ParamName == \"source8\")\n{\n    // fall back to empty-source pipeline or log configuration error\n}","preventionTips":["Never let stream factories return null; return AsyncObservable.Empty instead","Null-check all zipped sources in one guard helper before composing","Cover multi-source wiring with unit tests that assert non-null observables"],"tags":["null-argument","async-rx","zip-operator"],"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"}