{"record":{"id":"6b4df909b745504e","repo":"dotnet/reactive","slug":"value-cannot-be-null-parameter-other-queryablepattern","errorCode":null,"errorMessage":"Value cannot be null. (Parameter 'other')","messagePattern":"Value cannot be null\\. \\(Parameter 'other'\\)","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"Rx.NET/Source/src/System.Reactive/Joins/QueryablePattern.Generated.cs","lineNumber":40,"sourceCode":"    public class QueryablePattern<TSource1, TSource2> : QueryablePattern\n    {\n        internal QueryablePattern(Expression expression)\n            : base(expression)\n        {\n        }\n\n        /// <summary>\n        /// Creates a pattern that matches when all three observable sequences have an available element.\n        /// </summary>\n        /// <typeparam name=\"TSource3\">The type of the elements in the third observable sequence.</typeparam>\n        /// <param name=\"other\">Observable sequence to match with the two previous sequences.</param>\n        /// <returns>Pattern object that matches when all observable sequences have an available element.</returns>\n        /// <exception cref=\"ArgumentNullException\"><paramref name=\"other\"/> is null.</exception>\n        public QueryablePattern<TSource1, TSource2, TSource3> And<TSource3>(IObservable<TSource3> other)\n        {\n            if (other == null)\n            {\n                throw new ArgumentNullException(nameof(other));\n            }\n\n            var t = typeof(QueryablePattern<TSource1, TSource2>);\n            var m = t.GetMethod(nameof(And)).MakeGenericMethod(typeof(TSource3));\n            return new QueryablePattern<TSource1, TSource2, TSource3>(\n                Expression.Call(\n                    Expression,\n                    m,\n                    Qbservable.GetSourceExpression(other)\n                )\n            );\n        }\n\n        /// <summary>\n        /// Matches when all observable sequences have an available element and projects the elements by invoking the selector function.\n        /// </summary>\n        /// <typeparam name=\"TResult\">The type of the elements in the result sequence, returned by the selector function.</typeparam>\n        /// <param name=\"selector\">Selector that will be invoked for elements in the source sequences.</param>","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/dotnet/reactive/blob/94b5d5ab912789f5abe9a72138a25bbd716fe59c/Rx.NET/Source/src/System.Reactive/Joins/QueryablePattern.Generated.cs#L22-L58","documentation":"QueryablePattern<TSource1,TSource2>.And<TSource3> extends a two-sequence queryable join pattern with a third observable and throws ArgumentNullException when that sequence is null. This variant builds an expression tree (Expression.Call) for the IQbservable provider, which still requires a non-null source sequence. Raised from the public And method.","triggerScenarios":"Calling queryablePattern.And(null) on a QueryablePattern<TSource1,TSource2>, e.g. a null IObservable<TSource3> from an unassigned variable or a null-returning provider method.","commonSituations":"IQbservable-based scenarios (e.g. IQbservable over a remote service) where the third sequence comes from a query provider that returned null; mixing System.Reactive and System.Reactive.Providers code paths in tests.","solutions":["Ensure the third observable is non-null before calling And on the queryable pattern.","Use Observable.Empty<T>()/Observable.Never<T>() as an explicit placeholder sequence.","Fix the query provider/factory so it returns a valid IQbservable instead of null."],"exampleFix":"// before\nvar qp = pattern.And(thirdSource); // null\n// after\nvar qp = pattern.And(thirdSource ?? Observable.Empty<TThird>());","handlingStrategy":"validation","validationCode":"if (source3 == null) throw new ArgumentNullException(nameof(source3));\nvar qp = queryablePattern.And(source3);","typeGuard":"bool HasSource3<T3>(IObservable<T3>? o) => o is not null;","tryCatchPattern":"try { qp = queryablePattern.And(source3); }\ncatch (ArgumentNullException ex) when (ex.ParamName == \"other\") { log.Error(\"Null third sequence for QueryablePattern.And\"); throw; }","preventionTips":["Ensure query providers return non-null IQbservable instances","Default missing streams to Observable.Empty before pattern building","Enable nullable reference types for Rx-heavy code"],"tags":["null-argument","reactive-extensions","queryable-pattern"],"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"}