{"record":{"id":"295a2153b3996f03","repo":"dotnet/reactive","slug":"value-cannot-be-null-parameter-source16","errorCode":null,"errorMessage":"Value cannot be null. (Parameter 'source16')","messagePattern":"Value cannot be null\\. \\(Parameter 'source16'\\)","errorType":"validation","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"Rx.NET/Source/src/System.Reactive/Linq/Observable.Multiple.Zip.cs","lineNumber":1169,"sourceCode":"\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 (source15 == null)\n            {\n                throw new ArgumentNullException(nameof(source15));\n            }\n\n            if (source16 == null)\n            {\n                throw new ArgumentNullException(nameof(source16));\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, source15, source16, resultSelector);\n        }\n\n    }\n\n#pragma warning disable CA1711 // (Don't use Ex suffix.) This has been a public type for many years, so we can't rename it now.\n    public static partial class ObservableEx\n#pragma warning restore CA1711\n    {\n        /// <summary>\n        /// Merges the specified observable sequences into one observable sequence of tuple values whenever all of the observable sequences have produced an element at a corresponding index.","sourceCodeStart":1151,"sourceCodeEnd":1187,"githubUrl":"https://github.com/dotnet/reactive/blob/94b5d5ab912789f5abe9a72138a25bbd716fe59c/Rx.NET/Source/src/System.Reactive/Linq/Observable.Multiple.Zip.cs#L1151-L1187","documentation":"ArgumentNullException (Parameter 'source16'): the 16th and final observable source of the 16-ary Observable.Zip overload is null. The operator validates all sources first (then resultSelector), throwing ArgumentNullException naming the null parameter before any subscription occurs.","triggerScenarios":"Observable.Zip(source1..source16, resultSelector) called with source16 == null, typically the last-added source after expanding a smaller zip, or a trailing optional stream left null.","commonSituations":"Growing a zip from 15 to 16 sources and forgetting the new argument, default parameter values of null, or template-generated source lists with a trailing empty slot.","solutions":["Provide a non-null IObservable<T> for the 16th argument.","Substitute Observable.Empty<T>() / Observable.Never<T>() when the final stream is intentionally absent.","Null-check all sources together before invoking Zip.","Reconsider arity: use the IEnumerable overload when sources are dynamic."],"exampleFix":"// before\nZip(..., s15, s16 /* null */, sel);\n// after\nZip(..., s15, s16 ?? Observable.Empty<int>(), sel);","handlingStrategy":"validation","validationCode":"if (source16 == null) throw new ArgumentNullException(nameof(source16));\n// or:\nvar s16 = source16 ?? Observable.Empty<T16>();","typeGuard":"static IObservable<T> Coalesce<T>(IObservable<T>? o) => o ?? Observable.Empty<T>();\nvar s16 = Coalesce(source16);","tryCatchPattern":"try\n{\n    var zipped = Observable.Zip(source1, /* ... */ source16, selector);\n}\ncatch (ArgumentNullException ex) when (ex.ParamName == nameof(source16))\n{\n    logger.LogError(ex, \"source16 was null when composing Zip\");\n}","preventionTips":["When adding the last source to a zip, assign it before the composition call.","Avoid default null parameters for observable arguments; require overloads instead.","Review generated code templates for trailing empty source slots.","Adopt nullable annotations so IObservable<T>? vs IObservable<T> is explicit."],"tags":["null-argument","rxjs","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"}