{"record":{"id":"898b1096a36b8622","repo":"dotnet/reactive","slug":"value-cannot-be-null-parameter-source12","errorCode":null,"errorMessage":"Value cannot be null. (Parameter 'source12')","messagePattern":"Value cannot be null\\. \\(Parameter 'source12'\\)","errorType":"validation","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"AsyncRx.NET/System.Reactive.Async/Linq/Operators/Zip.Generated.cs","lineNumber":1144,"sourceCode":"                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            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\n            return Create<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)>(async observer =>\n            {\n                var d = new CompositeAsyncDisposable();\n\n                var (observer1, observer2, observer3, observer4, observer5, observer6, observer7, observer8, observer9, observer10, observer11, observer12) = 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                var sub9 = source9.SubscribeSafeAsync(observer9).AsTask().ContinueWith(disposable => d.AddAsync(disposable.Result).AsTask()).Unwrap();\n                var sub10 = source10.SubscribeSafeAsync(observer10).AsTask().ContinueWith(disposable => d.AddAsync(disposable.Result).AsTask()).Unwrap();\n                var sub11 = source11.SubscribeSafeAsync(observer11).AsTask().ContinueWith(disposable => d.AddAsync(disposable.Result).AsTask()).Unwrap();","sourceCodeStart":1126,"sourceCodeEnd":1162,"githubUrl":"https://github.com/dotnet/reactive/blob/94b5d5ab912789f5abe9a72138a25bbd716fe59c/AsyncRx.NET/System.Reactive.Async/Linq/Operators/Zip.Generated.cs#L1126-L1162","documentation":"ArgumentNullException thrown by the generated 12-ary Zip operator when the final source observable (source12) is null. The operator's validation block checks all twelve sources in order and this is the last check before it proceeds to build the zip via Create and AsyncObserver.Zip — meaning arguments 1-11 were valid and only the 12th was null.","triggerScenarios":"AsyncObservable.Zip(s1..s12) invoked with a null 12th argument: a last parameter left null because it was considered 'optional', or a producer returning null on an error path.","commonSituations":"Trailing arguments in very long calls are the most frequently left null; appending a new stream to an existing Zip and forgetting to create it; test scaffolding that stubs only the first N sources.","solutions":["Create or resolve the 12th source before the call; fix any null-returning producer.","Pass AsyncObservable.Empty<T>() if the twelfth stream is genuinely optional.","Reformat the call one-argument-per-line to make nulls visible in review.","Add a guard clause or assertion in the composing method."],"exampleFix":"// before\nvar zipped = AsyncObservable.Zip(s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, null);\n// after\nvar s12 = CreateSource12();\nvar zipped = AsyncObservable.Zip(s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12);","handlingStrategy":"validation","validationCode":"if (s12 == null) throw new InvalidOperationException(\"source12 must be provided before Zip\");","typeGuard":"static bool IsNotNullSource<T>(IAsyncObservable<T>? s) => s is not null;","tryCatchPattern":"try { var zipped = AsyncObservable.Zip(s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12); }\ncatch (ArgumentNullException ex) when (ex.ParamName == \"source12\") { log.Error(\"source12 was null\"); }","preventionTips":["Do not treat trailing arguments as implicitly optional.","Create all sources before the composition statement, never inline.","Add assertions in test fixtures that every stubbed source is non-null."],"tags":["argument-null","zip","reactive-extensions","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-23T08:17:48.524Z"}