{"record":{"id":"48d6452f4e751052","repo":"dotnet/reactive","slug":"left-qbservable-joins","errorCode":null,"errorMessage":"left","messagePattern":"left","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"Rx.NET/Source/src/System.Reactive/Linq/Qbservable.Joins.cs","lineNumber":29,"sourceCode":"{\n    public static partial class Qbservable\n    {\n        /* NOTE: Keep XML docs consistent with the corresponding Observable methods (modulo the IQbservableProvider parameters of course). */\n\n        /// <summary>\n        /// Creates a pattern that matches when both observable sequences have an available element.\n        /// </summary>\n        /// <typeparam name=\"TLeft\">The type of the elements in the left sequence.</typeparam>\n        /// <typeparam name=\"TRight\">The type of the elements in the right sequence.</typeparam>\n        /// <param name=\"left\">Observable sequence to match with the right sequence.</param>\n        /// <param name=\"right\">Observable sequence to match with the left sequence.</param>\n        /// <returns>Pattern object that matches when both observable sequences have an available element.</returns>\n        /// <exception cref=\"ArgumentNullException\"><paramref name=\"left\"/> or <paramref name=\"right\"/> is null.</exception>\n        public static QueryablePattern<TLeft, TRight> And<TLeft, TRight>(this IQbservable<TLeft> left, IObservable<TRight> right)\n        {\n            if (left == null)\n            {\n                throw new ArgumentNullException(nameof(left));\n            }\n\n            if (right == null)\n            {\n                throw new ArgumentNullException(nameof(right));\n            }\n\n            return new QueryablePattern<TLeft, TRight>(\n                Expression.Call(\n                    null,\n                    new Func<IQbservable<TLeft>, IObservable<TRight>, QueryablePattern<TLeft, TRight>>(And).Method,\n                    left.Expression,\n                    GetSourceExpression(right)\n                )\n            );\n        }\n\n        /// <summary>","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/dotnet/reactive/blob/94b5d5ab912789f5abe9a72138a25bbd716fe59c/Rx.NET/Source/src/System.Reactive/Linq/Qbservable.Joins.cs#L11-L47","documentation":"QueryableExtensions.And(left, right) combines an IQbservable left pattern with a right observable into a QueryablePattern; both operands must be non-null. The method throws ArgumentNullException(\"left\") when the left IQbservable<TLeft> is null. Because this is the queryable (expression-tree) variant, the null check happens locally before the Expression.Call is built — a null left cannot be translated.","triggerScenarios":"Calling left.And(right) where left is a null IQbservable<TLeft>, e.g. chaining off a query provider method that returned null.","commonSituations":"Building join patterns in IQbservable-based (e.g. Rx over remote/IQbservableProvider) pipelines where an earlier query step returned null instead of an empty sequence.","solutions":["Ensure the left query is produced by a real IQbservableProvider (e.g. provider.CreateQuery) rather than null.","Substitute an empty queryable sequence when the left side has no data.","Null-check the left query before composing the And pattern."],"exampleFix":"// before\nIQbservable<int> left = GetLeftQuery(); // null\nvar pattern = left.And(right);\n// after\nIQbservable<int> left = GetLeftQuery() ?? provider.CreateQuery<int>(Observable.Empty<int>());\nvar pattern = left.And(right);","handlingStrategy":"validation","validationCode":"if (left is null) throw new InvalidOperationException(\"left query must be created by an IQbservableProvider\");\nvar pattern = left.And(right);","typeGuard":"bool HasLeftQuery<TL, TR>(IQbservable<TL>? l, IObservable<TR>? r) => l is not null && r is not null;","tryCatchPattern":"try { var pattern = left.And(right); }\ncatch (ArgumentNullException ex) when (ex.ParamName == \"left\") { /* rebuild left via provider.CreateQuery before retrying */ }","preventionTips":["Only obtain IQbservable instances from a provider's CreateQuery","Never let query-chain helpers return null; return empty queries","Check nullable-reference-type warnings in query composition code"],"tags":["argument-null","qbservable","join-pattern","rx","dotnet"],"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"}