{"record":{"id":"fd111396fb8b1be5","repo":"SignalR/SignalR","slug":"method","errorCode":null,"errorMessage":"method","messagePattern":"method","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.AspNet.SignalR.Client/Hubs/HubProxy.cs","lineNumber":89,"sourceCode":"            return Invoke<object>(method, args);\n        }\n\n        public Task<T> Invoke<T>(string method, params object[] args)\n        {\n            return Invoke<T, object>(method, onProgress: null, args: args);\n        }\n\n        public Task Invoke<T>(string method, Action<T> onProgress, params object[] args)\n        {\n            return Invoke<object, T>(method, onProgress, args);\n        }\n\n        [SuppressMessage(\"Microsoft.Design\", \"CA1031:DoNotCatchGeneralExceptionTypes\", Justification = \"Exceptions are flown to the caller\")]\n        public Task<TResult> Invoke<TResult, TProgress>(string method, Action<TProgress> onProgress, params object[] args)\n        {\n            if (method == null)\n            {\n                throw new ArgumentNullException(\"method\");\n            }\n\n            if (args == null)\n            {\n                throw new ArgumentNullException(\"args\");\n            }\n\n            var tokenifiedArguments = new JToken[args.Length];\n            for (int i = 0; i < tokenifiedArguments.Length; i++)\n            {\n                tokenifiedArguments[i] = args[i] != null\n                    ? JToken.FromObject(args[i], JsonSerializer)\n                    : JValue.CreateNull();\n            }\n\n            var tcs = new DispatchingTaskCompletionSource<TResult>();\n            var callbackId = _connection.RegisterCallback(result =>\n            {","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/SignalR/SignalR/blob/693053b89a9e1f5ce819e3233ed159a6409de22b/src/Microsoft.AspNet.SignalR.Client/Hubs/HubProxy.cs#L71-L107","documentation":"Thrown by HubProxy.Invoke<TResult,TProgress> when the method parameter is null. The method name identifies the server hub method to call, so a null name cannot be serialized into the hub invocation envelope and is rejected before any network activity.","triggerScenarios":"Calling proxy.Invoke(null, ...) or proxy.Invoke<T>(null, onProgress, ...) where the method name argument is null; passing a method name read from config that resolved to null.","commonSituations":"Method name sourced from a constant that was misnamed/removed, or constructed dynamically and resulting in null.","solutions":["Pass the exact server hub method name (a non-null string) to Invoke.","If the name is dynamic, validate it is non-null and non-whitespace before invoking.","Confirm the method name spelling/casing matches the public method on the Hub subclass."],"exampleFix":"// before\nawait proxy.Invoke(methodName, args); // methodName is null\n\n// after\nif (string.IsNullOrWhiteSpace(methodName))\n    throw new ArgumentException(\"Hub method name required.\", nameof(methodName));\nawait proxy.Invoke(methodName, args);","handlingStrategy":"validation","validationCode":"if (string.IsNullOrWhiteSpace(method))\n    throw new ArgumentException(\"Server hub method name is required.\", nameof(method));\nawait proxy.Invoke(method, args);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use named constants for hub method names shared with the server.","Enable nullable reference types so a null method name surfaces at compile time.","Validate dynamically-built method names before invoking."],"tags":["signalr","hub","rpc","argument-validation"],"backgroundTag":null,"analyzedSha":"693053b89a9e1f5ce819e3233ed159a6409de22b","analyzedAt":"2026-08-13T22:23:59.793Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}