{"record":{"id":"4651b12f9fa2a5cb","repo":"dotnet/reactive","slug":"argumentnullexception-nameof-other","errorCode":null,"errorMessage":"ArgumentNullException(nameof(other))","messagePattern":"ArgumentNullException\\(nameof\\(other\\)\\)","errorType":"validation","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"Rx.NET/Source/src/System.Reactive/Linq/Observable.Multiple.cs","lineNumber":771,"sourceCode":"        /// Starting from Rx.NET 4.0, this will subscribe to <paramref name=\"other\"/> before subscribing to <paramref name=\"source\" />\n        /// so in case <paramref name=\"other\" /> emits an element right away, elements from <paramref name=\"source\" /> are not missed.\n        /// </summary>\n        /// <typeparam name=\"TSource\">The type of the elements in the source sequence.</typeparam>\n        /// <typeparam name=\"TOther\">The type of the elements in the other sequence that indicates the end of skip behavior.</typeparam>\n        /// <param name=\"source\">Source sequence to propagate elements for.</param>\n        /// <param name=\"other\">Observable sequence that triggers propagation of elements of the source sequence.</param>\n        /// <returns>An observable sequence containing the elements of the source sequence starting from the point the other sequence triggered propagation.</returns>\n        /// <exception cref=\"ArgumentNullException\"><paramref name=\"source\"/> or <paramref name=\"other\"/> is null.</exception>\n        public static IObservable<TSource> SkipUntil<TSource, TOther>(this IObservable<TSource> source, IObservable<TOther> other)\n        {\n            if (source == null)\n            {\n                throw new ArgumentNullException(nameof(source));\n            }\n\n            if (other == null)\n            {\n                throw new ArgumentNullException(nameof(other));\n            }\n\n            return s_impl.SkipUntil(source, other);\n        }\n\n        #endregion\n\n        #region + Switch +\n\n        /// <summary>\n        /// Transforms an observable sequence of observable sequences into an observable sequence \n        /// producing values only from the most recent observable sequence.\n        /// Each time a new inner observable sequence is received, unsubscribe from the \n        /// previous inner observable sequence.\n        /// </summary>\n        /// <typeparam name=\"TSource\">The type of the elements in the source sequences.</typeparam>\n        /// <param name=\"sources\">Observable sequence of inner observable sequences.</param>\n        /// <returns>The observable sequence that at any point in time produces the elements of the most recent inner observable sequence that has been received.</returns>","sourceCodeStart":753,"sourceCodeEnd":789,"githubUrl":"https://github.com/dotnet/reactive/blob/94b5d5ab912789f5abe9a72138a25bbd716fe59c/Rx.NET/Source/src/System.Reactive/Linq/Observable.Multiple.cs#L753-L789","documentation":"System.Reactive throws ArgumentNullException when the other (trigger) sequence passed to SkipUntil(source, other) is null. The source has already been validated at this point; the trigger sequence is a required argument because SkipUntil's gating behavior depends on it, so a null value throws synchronously at the call site.","triggerScenarios":"source.SkipUntil(null), e.g. a gate/trigger observable obtained from an event bus or configuration that returned null, or a field holding the trigger never initialized.","commonSituations":"Missing trigger wiring in composition-root code; a service returning null for the gating stream; tests where the trigger subject was not created before the pipeline was built.","solutions":["Supply a real trigger sequence, e.g. a Subject<object> or Observable.Never<object>() if it should never fire","Fix the provider/resolver that returned the null trigger","If 'never skip' is intended, pass Observable.Empty<object>() (which fires immediately) rather than null"],"exampleFix":"// before\nvar gated = data.SkipUntil(trigger); // trigger == null\n// after\nvar gated = data.SkipUntil(trigger ?? Observable.Never<Unit>());","handlingStrategy":"validation","validationCode":"if (other is null) other = Observable.Never<Unit>(); // never fires, or Observable.Empty<Unit>() to fire immediately\nvar gated = source.SkipUntil(other);","typeGuard":"static bool HasTrigger<T>(IObservable<T>? o) => o is not null;","tryCatchPattern":"try\n{\n    gated = source.SkipUntil(other);\n}\ncatch (ArgumentNullException ex) when (ex.ParamName == \"other\")\n{\n    gated = source; // skip gating entirely\n}","preventionTips":["Wire trigger subjects before building the gated pipeline","Default missing triggers to Observable.Never<Unit>() or Observable.Empty<Unit>(), not null","Validate event-bus/config-provided gate streams at startup"],"tags":["csharp","rxjs","null-argument","argument-validation"],"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"}