{"record":{"id":"9fedf761ebf16444","repo":"dotnet/reactive","slug":"throw-new-argumentnullexception-nameof-ninth","errorCode":null,"errorMessage":"throw new ArgumentNullException(nameof(ninth))","messagePattern":"throw new ArgumentNullException\\(nameof\\(ninth\\)\\)","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"Rx.NET/Source/src/System.Reactive/Linq/QbservableEx.Homoicon.cs","lineNumber":912,"sourceCode":"        {\n            if (first == null)\n                throw new ArgumentNullException(nameof(first));\n            if (second == null)\n                throw new ArgumentNullException(nameof(second));\n            if (third == null)\n                throw new ArgumentNullException(nameof(third));\n            if (fourth == null)\n                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            if (fourteenth == null)\n                throw new ArgumentNullException(nameof(fourteenth));\n            if (fifteenth == null)\n                throw new ArgumentNullException(nameof(fifteenth));\n            if (sixteenth == null)\n                throw new ArgumentNullException(nameof(sixteenth));\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, TFourteenth Fourteenth, TFifteenth Fifteenth, TSixteenth Sixteenth)>(\n                Expression.Call(\n                    null,","sourceCodeStart":894,"sourceCodeEnd":930,"githubUrl":"https://github.com/dotnet/reactive/blob/94b5d5ab912789f5abe9a72138a25bbd716fe59c/Rx.NET/Source/src/System.Reactive/Linq/QbservableEx.Homoicon.cs#L894-L930","documentation":"System.ArgumentNullException raised by the null-guard for the ninth source in a CombineLatest overload in QbservableEx.Homoicon.cs. The guard ensures no null source enters the expression tree handed to the IQbservableProvider.","triggerScenarios":"Invoking the 9+ argument Qbservable.CombineLatest overload with ninth == null at line 912 of the guard chain.","commonSituations":"A nullable stream from optional configuration; a late-bound service observable that was not registered when the query was composed.","solutions":["Provide a non-null ninth IQbservable argument.","Use an empty placeholder stream for absent optional sources.","Fix the initialization order so the ninth stream exists before the query is built.","Add a unit test covering the composition call with all sources supplied."],"exampleFix":"// before\nvar q = CombineLatest(s1, s2, s3, s4, s5, s6, s7, s8, null, sel); // ninth null\n// after\nvar ninth = GetNinthStream() ?? provider.CreateQuery<T9>(Expression.Constant(Observable.Empty<T9>()));\nvar q = CombineLatest(s1, s2, s3, s4, s5, s6, s7, s8, ninth, sel);","handlingStrategy":"validation","validationCode":"if (s9 == null) s9 = provider.CreateQuery<T9>(Expression.Constant(Observable.Empty<T9>()));","typeGuard":"static bool IsNonNullSource<T>(IQbservable<T> s) => s != null;","tryCatchPattern":"try { CombineLatest(..., s9, ...); } catch (ArgumentNullException ex) when (ex.ParamName == \"ninth\") { /* substitute empty source and retry */ }","preventionTips":["Initialize late-bound stream dependencies eagerly","Use null-coalescing assignment for optional sources","Log which source slot was null to speed diagnosis","Keep stream factories total (never return null)"],"tags":["argumentnull","qbservable","combinelatest"],"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"}