{"record":{"id":"ed0269189bc6008c","repo":"peass-ng/PEASS-ng","slug":"not-an-enumeration-type","errorCode":null,"errorMessage":"Not an enumeration type","messagePattern":"Not an enumeration type","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"winPEAS/winPEASexe/winPEAS/3rdParty/BouncyCastle/util/Enums.cs","lineNumber":41,"sourceCode":"\n#if NETCF_1_0\n                FieldInfo field = enumType.GetField(s, BindingFlags.Static | BindingFlags.Public);\n                if (field != null)\n                {\n                    return (Enum)field.GetValue(null);\n                }\n#else\n                return (Enum)Enum.Parse(enumType, s, false);\n#endif\t\t\n            }\n\n            throw new ArgumentException();\n        }\n\n        internal static Array GetEnumValues(System.Type enumType)\n        {\n            if (!IsEnumType(enumType))\n                throw new ArgumentException(\"Not an enumeration type\", \"enumType\");\n\n#if NETCF_1_0 || NETCF_2_0 || SILVERLIGHT\n            IList result = Platform.CreateArrayList();\n            FieldInfo[] fields = enumType.GetFields(BindingFlags.Static | BindingFlags.Public);\n            foreach (FieldInfo field in fields)\n            {\n                // Note: Argument to GetValue() ignored since the fields are static,\n                //     but Silverlight for Windows Phone throws exception if we pass null\n                result.Add(field.GetValue(enumType));\n            }\n            object[] arr = new object[result.Count];\n            result.CopyTo(arr, 0);\n            return arr;\n#else\n            return Enum.GetValues(enumType);\n#endif\n        }\n","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/peass-ng/PEASS-ng/blob/53fb989abc2219826385683a6fee826bd6cd38d6/winPEAS/winPEASexe/winPEAS/3rdParty/BouncyCastle/util/Enums.cs#L23-L59","documentation":"A type validation guard in Enums.GetEnumValues: the method reflects over the supplied System.Type to enumerate its values and requires it to be an enum type; IsEnumType returned false, so the non-enum Type was rejected via this ArgumentException. The faulting input is the 'enumType' argument, e.g. a class or value type passed where an enum Type was expected.","triggerScenarios":"Thrown at winPEAS/winPEASexe/winPEAS/3rdParty/BouncyCastle/util/Enums.cs:41 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass typeof(SomeEnum) — a Type whose IsEnum is true","Guard with type.IsEnum before calling GetEnumValues","Use Enum.GetValues directly when full-framework APIs are available"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"53fb989abc2219826385683a6fee826bd6cd38d6","analyzedAt":"2026-09-02T04:25:09.259Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T11:17:12.671Z"}