{"record":{"id":"70007bd6259611e1","repo":"HangfireIO/Hangfire","slug":"featureid","errorCode":null,"errorMessage":"featureId","messagePattern":"featureId","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"src/Hangfire.Core/JobStorage.cs","lineNumber":121,"sourceCode":"        }\n\n        public virtual IEnumerable<IBackgroundProcess> GetStorageWideProcesses()\n        {\n            return Enumerable.Empty<IBackgroundProcess>();\n        }\n\n        public virtual IEnumerable<IStateHandler> GetStateHandlers()\n        {\n            return Enumerable.Empty<IStateHandler>();\n        }\n\n        public virtual void WriteOptionsToLog(ILog logger)\n        {\n        }\n\n        public virtual bool HasFeature([NotNull] string featureId)\n        {\n            if (featureId == null) throw new ArgumentNullException(nameof(featureId));\n            return false;\n        }\n    }\n}\n","sourceCodeStart":103,"sourceCodeEnd":126,"githubUrl":"https://github.com/HangfireIO/Hangfire/blob/c236dd0f930f831ec151e436e138ddc429a02a72/src/Hangfire.Core/JobStorage.cs#L103-L126","documentation":"Thrown by JobStorage.HasFeature when the featureId parameter is null. HasFeature is a virtual method that returns false by default (base JobStorage); storage implementations override it to advertise capabilities. The base implementation guards against a null feature identifier.","triggerScenarios":"Calling storage.HasFeature(null) or passing a variable for the featureId that resolved to null. Also triggered by internal Hangfire code if a feature ID constant is somehow null.","commonSituations":"Custom storage implementation calling base.HasFeature(null) in an override, or application code checking for a feature using a dynamic string that was null. Rare in practice since feature IDs are typically constants from JobStorageFeatures.","solutions":["Use constants from JobStorageFeatures (e.g., JobStorageFeatures.ProcessesInsteadOfComponents) rather than dynamic strings","Validate the featureId is non-null before calling HasFeature","In custom storage overrides, guard against null before delegating to base.HasFeature"],"exampleFix":"// before\nif (storage.HasFeature(featureName)) // featureName is null\n\n// after\nif (!string.IsNullOrEmpty(featureName) && storage.HasFeature(featureName))","handlingStrategy":"validation","validationCode":"if (string.IsNullOrEmpty(featureId))\n    throw new ArgumentException(\"Feature ID must be non-empty.\", nameof(featureId));\nvar supported = storage.HasFeature(featureId);","typeGuard":"!string.IsNullOrEmpty(featureId)","tryCatchPattern":null,"preventionTips":["Use constants from JobStorageFeatures rather than dynamic strings for feature IDs","Validate feature IDs from external sources before passing to HasFeature","In custom storage overrides, guard against null before delegating to base"],"tags":["null-argument","job-storage","feature-detection","hangfire"],"backgroundTag":null,"analyzedSha":"c236dd0f930f831ec151e436e138ddc429a02a72","analyzedAt":"2026-08-13T20:27:11.027Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}