{"record":{"id":"9c00c1a838b0329a","repo":"dotnet/BenchmarkDotNet","slug":"name-can-t-be-null","errorCode":null,"errorMessage":"{name} can't be null","messagePattern":"(.+?) can't be null","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"src/BenchmarkDotNet/Helpers/Assertion.cs","lineNumber":11,"sourceCode":"using JetBrains.Annotations;\n\nnamespace BenchmarkDotNet.Helpers;\n\ninternal static class Assertion\n{\n    [AssertionMethod]\n    public static void NotNull(string name, object? value)\n    {\n        if (value == null)\n            throw new ArgumentNullException(name, $\"{name} can't be null\");\n    }\n}","sourceCodeStart":1,"sourceCodeEnd":13,"githubUrl":"https://github.com/dotnet/BenchmarkDotNet/blob/b515068b61ad1c9c9aa938b8ece4af1e7d6d85a3/src/BenchmarkDotNet/Helpers/Assertion.cs#L1-L13","documentation":"Assertion.NotNull is an internal assertion helper annotated with [AssertionMethod]. It throws ArgumentNullException with message \"{name} can't be null\" when value is null. It is used internally to fail fast on null invariants the library depends on; the message text is a thin wrapper over ArgumentNullException.","triggerScenarios":"An internal BenchmarkDotNet code path calls Assertion.NotNull(name, value) and value is null, indicating a violated precondition (e.g. a required descriptor, job, or report object was unexpectedly null).","commonSituations":"A previous step failed to produce a required object (a benchmark case missing a descriptor, a job without a runtime), corrupted/incomplete state, or a library bug where an internal contract was not upheld.","solutions":["Inspect the stack trace to find which internal contract was violated and the originating config/setup.","Ensure all required benchmark setup objects (attributes, configs, jobs) are fully specified.","If state looks correct, report a BenchmarkDotNet issue with the reproduction; this asserts an internal invariant."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { /* setup/run */ }\ncatch (ArgumentNullException ex) when (ex.Message.Contains(\"can't be null\")) { /* inspect stack, report library issue */ }","preventionTips":["Fully specify all required benchmark setup (jobs, runtimes, descriptors).","Inspect the stack trace to find the violated internal invariant.","Report reproducible internal-assertion failures to BenchmarkDotNet."],"tags":["validation","assertion","internal","null"],"backgroundTag":null,"analyzedSha":"b515068b61ad1c9c9aa938b8ece4af1e7d6d85a3","analyzedAt":"2026-08-13T19:12:24.196Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}