{"record":{"id":"829982c763afa352","repo":"HandyOrg/HandyControl","slug":"enumtype","errorCode":null,"errorMessage":"enumType","messagePattern":"enumType","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"src/Shared/HandyControl_Shared/Data/Enum/EnumDataProvider.cs","lineNumber":43,"sourceCode":"    }\n\n    private bool _useAttributes;\n\n    public bool UseAttributes\n    {\n        get => _useAttributes;\n        set\n        {\n            _useAttributes = value;\n            ObjectType = value ? typeof(EnumDataProvider) : typeof(System.Enum);\n        }\n    }\n\n    public static IEnumerable<EnumItem> GetValues(Type enumType)\n    {\n        if (enumType == null)\n        {\n            throw new ArgumentNullException(nameof(enumType));\n        }\n\n        var resultList = new List<EnumItem>();\n\n        var values = System.Enum.GetValues(enumType);\n        foreach (System.Enum value in values)\n        {\n            var fieldInfo = enumType.GetField(value.ToString());\n            if (fieldInfo == null)\n            {\n                continue;\n            }\n\n            if (fieldInfo.GetCustomAttributes(typeof(BrowsableAttribute), true) is BrowsableAttribute[] { Length: > 0 } browsableAttributes)\n            {\n                if (!browsableAttributes[0].Browsable)\n                {\n                    continue;","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/HandyOrg/HandyControl/blob/2c0875ebd67326e0c67282967e3e809c69282fee/src/Shared/HandyControl_Shared/Data/Enum/EnumDataProvider.cs#L25-L61","documentation":"Null guard in EnumDataProvider.GetValues: throws ArgumentNullException for 'enumType' when the caller passes a null Type where an enum type is required. The subsequent Enum.GetValues call would otherwise fail; this is a standard argument null check.","triggerScenarios":"Thrown at src/Shared/HandyControl_Shared/Data/Enum/EnumDataProvider.cs:43 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a non-null enum Type to GetValues","Check enumType for null (or use nameof arguments) before calling","Validate with type.IsEnum before invoking to also catch non-enum types"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2c0875ebd67326e0c67282967e3e809c69282fee","analyzedAt":"2026-09-14T14:45:29.754Z","contentChangedAt":"2026-09-14T14:45:29.754Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}