{"record":{"id":"1c50cd993bc369bb","repo":"HangfireIO/Hangfire","slug":"pathtemplate","errorCode":null,"errorMessage":"pathTemplate","messagePattern":"pathTemplate","errorType":"validation","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"src/Hangfire.Core/Dashboard/RouteCollectionExtensions.cs","lineNumber":72,"sourceCode":"            [NotNull] string pathTemplate,\n            [NotNull] Func<DashboardContext, bool> command)\n        {\n            if (routes == null) throw new ArgumentNullException(nameof(routes));\n            if (pathTemplate == null) throw new ArgumentNullException(nameof(pathTemplate));\n            if (command == null) throw new ArgumentNullException(nameof(command));\n\n            routes.Add(pathTemplate, new CommandDispatcher(command));\n        }\n\n#if FEATURE_OWIN\n        [Obsolete(\"Use the AddBatchCommand(RouteCollection, string, Func<DashboardContext, bool>) overload instead. Will be removed in 2.0.0.\")]\n        public static void AddBatchCommand(\n            [NotNull] this RouteCollection routes, \n            [NotNull] string pathTemplate, \n            [NotNull] Action<RequestDispatcherContext, string> command)\n        {\n            if (routes == null) throw new ArgumentNullException(nameof(routes));\n            if (pathTemplate == null) throw new ArgumentNullException(nameof(pathTemplate));\n            if (command == null) throw new ArgumentNullException(nameof(command));\n\n            routes.Add(pathTemplate, new BatchCommandDispatcher(command));\n        }\n#endif\n\n        public static void AddBatchCommand(\n            [NotNull] this RouteCollection routes,\n            [NotNull] string pathTemplate,\n            [NotNull] Action<DashboardContext, string> command)\n        {\n            if (routes == null) throw new ArgumentNullException(nameof(routes));\n            if (pathTemplate == null) throw new ArgumentNullException(nameof(pathTemplate));\n            if (command == null) throw new ArgumentNullException(nameof(command));\n\n            routes.Add(pathTemplate, new BatchCommandDispatcher(command));\n        }\n","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/HangfireIO/Hangfire/blob/c236dd0f930f831ec151e436e138ddc429a02a72/src/Hangfire.Core/Dashboard/RouteCollectionExtensions.cs#L54-L90","documentation":"The OWIN-specific AddBatchCommand overload (RouteCollectionExtensions.cs:72) throws ArgumentNullException when pathTemplate is null. The route collection needs a non-null path string to map the command dispatcher to a URL.","triggerScenarios":"Calling routes.AddBatchCommand(null, command) or routes.AddBatchCommand(someVariableThatIsNull, command) on the OWIN overload.","commonSituations":"Path template sourced from configuration that resolved to null; typo or missing constant; conditional path that evaluated to null.","solutions":["Provide a non-null path string (e.g. \"/enqueue\").","Validate configuration values before passing them as pathTemplate."],"exampleFix":"// before\nroutes.AddBatchCommand(config.DeletePath, (ctx, id) => Delete(id));\n// config.DeletePath is null\n\n// after\nroutes.AddBatchCommand(config.DeletePath ?? \"/delete\", (ctx, id) => Delete(id));","handlingStrategy":"validation","validationCode":"if (string.IsNullOrEmpty(pathTemplate))\n    throw new ArgumentException(\"pathTemplate is required.\");\nroutes.AddBatchCommand(pathTemplate, handler);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use non-null path string constants for route registration.","Validate config-sourced paths before use."],"tags":["dashboard","argument-null","owin","routes"],"backgroundTag":null,"analyzedSha":"c236dd0f930f831ec151e436e138ddc429a02a72","analyzedAt":"2026-08-13T20:27:11.027Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}