{"record":{"id":"628ce87ebf726cbe","repo":"dotnet/reactive","slug":"value-cannot-be-null-parameter-source14-628ce8","errorCode":null,"errorMessage":"Value cannot be null. (Parameter 'source14')","messagePattern":"Value cannot be null\\. \\(Parameter 'source14'\\)","errorType":"validation","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"Rx.NET/Source/src/System.Reactive/Linq/Observable.Multiple.Zip.cs","lineNumber":1159,"sourceCode":"\n            if (source11 == null)\n            {\n                throw new ArgumentNullException(nameof(source11));\n            }\n\n            if (source12 == null)\n            {\n                throw new ArgumentNullException(nameof(source12));\n            }\n\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);","sourceCodeStart":1141,"sourceCodeEnd":1177,"githubUrl":"https://github.com/dotnet/reactive/blob/94b5d5ab912789f5abe9a72138a25bbd716fe59c/Rx.NET/Source/src/System.Reactive/Linq/Observable.Multiple.Zip.cs#L1141-L1177","documentation":"ArgumentNullException (Parameter 'source14'): the 14th observable argument to the 16-ary Observable.Zip overload is null. The implementation checks every source sequentially and throws with the failing parameter name, so this error pinpoints exactly which slot was null.","triggerScenarios":"Observable.Zip(source1..source16, resultSelector) called with source14 == null, e.g. a nullable backing field, a dictionary TryGetValue path that ignored the miss, or a conditional build of sources leaving a gap.","commonSituations":"Caching layers returning null on cold start, feature flags removing a stream but leaving the zip arity unchanged, or copy-paste of a 14-source zip where the new source variable was never assigned.","solutions":["Assign a real IObservable<T> to the 14th argument before calling Zip.","Replace the null with Observable.Empty<T>()/Observable.Never<T>() to encode 'absent'.","Add a debug-time assertion enumerating all sources for nulls.","Refactor to the params/IEnumerable Zip overload for variable arity."],"exampleFix":"// before\nZip(..., s13, s14 /* null */, s15, ..., sel);\n// after\nZip(..., s13, s14 ?? Observable.Empty<decimal>(), s15, ..., sel);","handlingStrategy":"validation","validationCode":"if (source14 == null) throw new ArgumentNullException(nameof(source14));\n// or:\nvar s14 = source14 ?? Observable.Never<T14>();","typeGuard":"static IObservable<T> NonNull<T>(IObservable<T>? o) => o ?? Observable.Empty<T>();\nvar s14 = NonNull(source14);","tryCatchPattern":"try\n{\n    var zipped = Observable.Zip(source1, /* ... */ source14, /* ... */ source16, selector);\n}\ncatch (ArgumentNullException ex) when (ex.ParamName == nameof(source14))\n{\n    logger.LogError(ex, \"source14 was null when composing Zip\");\n}","preventionTips":["Use factories that guarantee non-null observables for all feature-flag states.","When growing a zip's arity, update all source variables in the same change.","Add a debug assertion scanning all zip inputs for nulls in test builds.","Prefer building sources into a list and using the collection Zip overload."],"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"}