{"record":{"id":"e45b2be46eea0a2d","repo":"dotnet/reactive","slug":"fifth","errorCode":null,"errorMessage":"fifth","messagePattern":"fifth","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"Rx.NET/Source/src/System.Reactive/Linq/QbservableEx.Homoicon.cs","lineNumber":145,"sourceCode":"        /// <param name=\"second\">Second observable source.</param>\n        /// <param name=\"third\">Third observable source.</param>\n        /// <param name=\"fourth\">Fourth observable source.</param>\n        /// <param name=\"fifth\">Fifth observable source.</param>\n        /// <returns>An observable sequence containing the result of combining elements of the sources using tuple values.</returns>\n        /// <exception cref=\"ArgumentNullException\">\n        /// <paramref name=\"first\" /> or <paramref name=\"second\" /> or <paramref name=\"third\" /> or <paramref name=\"fourth\" /> or <paramref name=\"fifth\" /> is null.</exception>\n        public static IQbservable<(TFirst First, TSecond Second, TThird Third, TFourth Fourth, TFifth Fifth)> CombineLatest<TFirst, TSecond, TThird, TFourth, TFifth>(this IQbservable<TFirst> first, IObservable<TSecond> second, IObservable<TThird> third, IObservable<TFourth> fourth, IObservable<TFifth> fifth)\n        {\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\n            return first.Provider.CreateQuery<(TFirst First, TSecond Second, TThird Third, TFourth Fourth, TFifth Fifth)>(\n                Expression.Call(\n                    null,\n                    new Func<IQbservable<TFirst>, IObservable<TSecond>, IObservable<TThird>, IObservable<TFourth>, IObservable<TFifth>, IQbservable<(TFirst First, TSecond Second, TThird Third, TFourth Fourth, TFifth Fifth)>>(CombineLatest<TFirst, TSecond, TThird, TFourth, TFifth>).Method,\n                    first.Expression,\n                    GetSourceExpression(second),\n                    GetSourceExpression(third),\n                    GetSourceExpression(fourth),\n                    GetSourceExpression(fifth)\n                )\n            );\n        }\n\n        /// <summary>\n        /// Merges the specified observable sequences into one observable sequence of tuple values whenever any of the observable sequences produces an element.\n        /// </summary>\n        /// <typeparam name=\"TFirst\">The type of the elements in the first source sequence.</typeparam>","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/dotnet/reactive/blob/94b5d5ab912789f5abe9a72138a25bbd716fe59c/Rx.NET/Source/src/System.Reactive/Linq/QbservableEx.Homoicon.cs#L127-L163","documentation":"Thrown by the 5-ary CombineLatest overload when the fifth (last) source sequence is null. This is the final guard in the method's validation chain before first.Provider.CreateQuery builds the combine expression. Null is not a valid stand-in for an empty or never-completing sequence in the Qbservable model.","triggerScenarios":"Calling first.CombineLatest(second, third, fourth, fifth) with fifth == null, e.g. a trailing optional stream that was never created.","commonSituations":"Feature-flagged last stream missing at runtime; array/list of sources indexed out to a null element; tests invoking the overload with only some arguments set.","solutions":["Pass a valid IObservable<TFifth> (Observable.Empty or Observable.Never if no data is expected).","Fix the producer that returned null for the fifth sequence.","Coalesce the argument before calling CombineLatest."],"exampleFix":"// before\nvar combined = first.CombineLatest(s2, s3, s4, fifth); // fifth null\n// after\nvar combined = first.CombineLatest(s2, s3, s4, fifth ?? Observable.Empty<TFifth>());","handlingStrategy":"validation","validationCode":"if (fifth == null) fifth = Observable.Empty<TFifth>();","typeGuard":"static bool IsObservableSet<T>(IObservable<T> source) => source != null;","tryCatchPattern":"try { var combined = first.CombineLatest(second, third, fourth, fifth); } catch (ArgumentNullException ex) when (ex.ParamName == \"fifth\") { logger.LogError(ex, \"Null fifth source passed to 5-ary CombineLatest\"); }","preventionTips":["Initialize trailing optional streams to Observable.Empty<T>() by default.","Use Observable.CombineLatest(params) style helpers that skip null entries.","Adopt nullable reference types so missing assignments to later sources are compile-time warnings."],"tags":["argumentnull","qbservable","combinelatest","reactive-extensions"],"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"}