{"record":{"id":"2ba722555894cc8b","repo":"dotnet/reactive","slug":"value-cannot-be-null-parameter-thirteenth-qbservableex","errorCode":null,"errorMessage":"Value cannot be null. (Parameter 'thirteenth')","messagePattern":"Value cannot be null\\. \\(Parameter 'thirteenth'\\)","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"Rx.NET/Source/src/System.Reactive/Linq/QbservableEx.Homoicon.cs","lineNumber":1929,"sourceCode":"                throw new ArgumentNullException(nameof(fourth));\n            if (fifth == null)\n                throw new ArgumentNullException(nameof(fifth));\n            if (sixth == null)\n                throw new ArgumentNullException(nameof(sixth));\n            if (seventh == null)\n                throw new ArgumentNullException(nameof(seventh));\n            if (eighth == null)\n                throw new ArgumentNullException(nameof(eighth));\n            if (ninth == null)\n                throw new ArgumentNullException(nameof(ninth));\n            if (tenth == null)\n                throw new ArgumentNullException(nameof(tenth));\n            if (eleventh == null)\n                throw new ArgumentNullException(nameof(eleventh));\n            if (twelfth == null)\n                throw new ArgumentNullException(nameof(twelfth));\n            if (thirteenth == null)\n                throw new ArgumentNullException(nameof(thirteenth));\n\n            return first.Provider.CreateQuery<(TFirst First, TSecond Second, TThird Third, TFourth Fourth, TFifth Fifth, TSixth Sixth, TSeventh Seventh, TEighth Eighth, TNinth Ninth, TTenth Tenth, TEleventh Eleventh, TTwelfth Twelfth, TThirteenth Thirteenth)>(\n                Expression.Call(\n                    null,\n                    new Func<IQbservable<TFirst>, IObservable<TSecond>, IObservable<TThird>, IObservable<TFourth>, IObservable<TFifth>, IObservable<TSixth>, IObservable<TSeventh>, IObservable<TEighth>, IObservable<TNinth>, IObservable<TTenth>, IObservable<TEleventh>, IObservable<TTwelfth>, IObservable<TThirteenth>, IQbservable<(TFirst First, TSecond Second, TThird Third, TFourth Fourth, TFifth Fifth, TSixth Sixth, TSeventh Seventh, TEighth Eighth, TNinth Ninth, TTenth Tenth, TEleventh Eleventh, TTwelfth Twelfth, TThirteenth Thirteenth)>>(Zip<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh, TEighth, TNinth, TTenth, TEleventh, TTwelfth, TThirteenth>).Method,\n                    first.Expression,\n                    GetSourceExpression(second),\n                    GetSourceExpression(third),\n                    GetSourceExpression(fourth),\n                    GetSourceExpression(fifth),\n                    GetSourceExpression(sixth),\n                    GetSourceExpression(seventh),\n                    GetSourceExpression(eighth),\n                    GetSourceExpression(ninth),\n                    GetSourceExpression(tenth),\n                    GetSourceExpression(eleventh),\n                    GetSourceExpression(twelfth),\n                    GetSourceExpression(thirteenth)","sourceCodeStart":1911,"sourceCodeEnd":1947,"githubUrl":"https://github.com/dotnet/reactive/blob/94b5d5ab912789f5abe9a72138a25bbd716fe59c/Rx.NET/Source/src/System.Reactive/Linq/QbservableEx.Homoicon.cs#L1911-L1947","documentation":"The 13-source Qbservable.Zip overload throws ArgumentNullException naming 'thirteenth' when the last source sequence is null. The check at line 1929 is the final guard before building the expression tree; without it, the null would surface as a confusing failure inside CreateQuery or the provider.","triggerScenarios":"Calling QbservableEx.Zip(first..thirteenth) with thirteenth == null.","commonSituations":"Optional trailing source in a programmatically assembled query; null returned by a lookup/factory for the final stream in a 13-way merge.","solutions":["Supply a valid IObservable<TThirteenth> for the thirteenth argument","Use Observable.Empty<TThirteenth>() as a null-safe default when the source is absent","Fix the producer so it never returns a null sequence"],"exampleFix":"// before\nvar zipped = QbservableEx.Zip(first, second, third, fourth, fifth, sixth, seventh, eighth, ninth, tenth, eleventh, twelfth, thirteenth /* null */);\n// after\nif (thirteenth == null) thirteenth = Observable.Empty<TThirteenth>();\nvar zipped = QbservableEx.Zip(first, second, third, fourth, fifth, sixth, seventh, eighth, ninth, tenth, eleventh, twelfth, thirteenth);","handlingStrategy":"validation","validationCode":"if (thirteenth is null) thirteenth = Observable.Empty<TThirteenth>();","typeGuard":"bool hasThirteenth = thirteenth is not null;","tryCatchPattern":"try\n{\n    var zipped = QbservableEx.Zip(first, second, third, fourth, fifth, sixth, seventh, eighth, ninth, tenth, eleventh, twelfth, thirteenth);\n}\ncatch (ArgumentNullException ex)\n{\n    logger.LogError(\"Zip failed: parameter {Param} was null\", ex.ParamName);\n    throw;\n}","preventionTips":["Guard optional trailing sources with ?? Observable.Empty<T>() before composition","Never let configuration-driven lookups yield null sequences","Write a composition helper that normalizes all sources in one place"],"tags":["csharp","rx","null-argument","qbservable"],"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"}