{"record":{"id":"b9e6e110c8a49256","repo":"stride3d/stride","slug":"name-cannot-be-empty","errorCode":null,"errorMessage":"Name cannot be empty","messagePattern":"Name cannot be empty","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"sources/core/Stride.Core/Diagnostics/ProfilingKey.cs","lineNumber":82,"sourceCode":"    /// </summary>\n    /// <value>The group.</value>\n    public ProfilingKey? Parent { get; }\n\n    /// <summary>\n    /// Gets the children.\n    /// </summary>\n    /// <value>\n    /// The children.\n    /// </value>\n    public List<ProfilingKey> Children { get; }\n\n    public override string ToString()\n    {\n        return Name;\n    }\n\n    private static string ValidateNameNotEmpty(string name) =>\n        !string.IsNullOrWhiteSpace(name) ? name : throw new ArgumentException(\"Name cannot be empty\", nameof(name));\n}\n","sourceCodeStart":64,"sourceCodeEnd":84,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/core/Stride.Core/Diagnostics/ProfilingKey.cs#L64-L84","documentation":"ValidateNameNotEmpty is ProfilingKey's shared name guard: it returns the name unchanged when it is non-null and not whitespace, otherwise throws ArgumentException('Name cannot be empty', nameof(name)). All ProfilingKey constructors route through it to keep profiling key names meaningful.","triggerScenarios":"new ProfilingKey(\"\"), new ProfilingKey(parent, null), or any constructor receiving a whitespace-only name string.","commonSituations":"Names built by concatenation where parts are empty; configuration-driven profiling categories with missing values.","solutions":["Supply a non-empty descriptive name when constructing the ProfilingKey","Validate/normalize the name (trim, fallback default) before construction","Check why the source string is empty (missing config/constant) and fix the source"],"exampleFix":"// before\nvar key = new ProfilingKey(categoryName); // may be \"\"\n// after\nvar key = new ProfilingKey(string.IsNullOrWhiteSpace(categoryName) ? \"default\" : categoryName);","handlingStrategy":"validation","validationCode":"if (string.IsNullOrWhiteSpace(name)) name = \"default\";\nvar key = new ProfilingKey(name);","typeGuard":"bool isValidKeyName(string name) => !string.IsNullOrWhiteSpace(name);","tryCatchPattern":"try { key = new ProfilingKey(name); }\ncatch (ArgumentException) { key = new ProfilingKey(\"default\"); }","preventionTips":["Validate profiling category names from config","Trim and normalize names before constructing keys","Fix empty sources (missing constants/config) rather than masking"],"tags":["profiling","argumentexception","empty-string","validation"],"backgroundTag":"empty-required-field","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}