{"record":{"id":"c5fe5249ae700c68","repo":"cefsharp/CefSharp","slug":"propertyinfo","errorCode":null,"errorMessage":"propertyInfo","messagePattern":"propertyInfo","errorType":"validation","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"CefSharp/ModelBinding/BindingMemberInfo.cs","lineNumber":37,"sourceCode":"        /// <summary>\n        /// Gets the name of the property or field represented by this BindingMemberInfo.\n        /// </summary>\n        public string Name { get; private set; }\n\n        /// <summary>\n        /// Gets the data type of the property or field represented by this BindingMemberInfo.\n        /// </summary>\n        public Type Type { get; private set; }\n\n        /// <summary>\n        /// Constructs a BindingMemberInfo instance for a property.\n        /// </summary>\n        /// <param name=\"propertyInfo\">The bindable property to represent.</param>\n        public BindingMemberInfo(PropertyInfo propertyInfo)\n        {\n            if (propertyInfo == null)\n            {\n                throw new ArgumentNullException(\"propertyInfo\");\n            }\n\n            memberInfo = propertyInfo;\n\n            Type = propertyInfo.PropertyType;\n            Name = propertyInfo.Name;\n        }\n\n        /// <summary>\n        /// Constructs a BindingMemberInfo instance for a field.\n        /// </summary>\n        /// <param name=\"fieldInfo\">The bindable field to represent.</param>\n        public BindingMemberInfo(FieldInfo fieldInfo)\n        {\n            if (fieldInfo == null)\n            {\n                throw new ArgumentNullException(\"fieldInfo\");\n            }","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/cefsharp/CefSharp/blob/16bc6e0711a4945be17e8bc4bc7ccf9469f3fdec/CefSharp/ModelBinding/BindingMemberInfo.cs#L19-L55","documentation":"Thrown by the BindingMemberInfo(PropertyInfo) constructor when propertyInfo is null. The constructor stores the member info and reads PropertyType/Name from it, so a null reference would otherwise cause a NullReferenceException later; the guard fails fast with ArgumentNullException naming 'propertyInfo'.","triggerScenarios":"Passing a PropertyInfo obtained via reflection that resolved to null (e.g. Type.GetProperty returned null for a misspelled/missing property), or passing a nullable expression without a null check.","commonSituations":"Reflecting over a member name that does not exist; refactoring a class so the reflected property disappears; binding infrastructure receiving a null from an upstream filter.","solutions":["Null-check the PropertyInfo (from Type.GetProperty) before constructing BindingMemberInfo.","Verify the property name/casing used in reflection calls.","Use nameof() to keep reflection strings in sync with members.","Fail with a descriptive error at the reflection site if the property is not found."],"exampleFix":"// before\nvar pi = type.GetProperty(\"Titel\"); // misspelling -> null\nvar bm = new BindingMemberInfo(pi);\n\n// after\nvar pi = type.GetProperty(nameof(MyVm.Title));\nif (pi == null) throw new InvalidOperationException(\"Property not found on \" + type);\nvar bm = new BindingMemberInfo(pi);","handlingStrategy":"type-guard","validationCode":"var pi = type.GetProperty(nameof(MyVm.Title));\nif (pi == null) throw new InvalidOperationException(\"Property not found on \" + type.FullName);\nvar bm = new BindingMemberInfo(pi);","typeGuard":"static bool TryCreate(PropertyInfo pi, out BindingMemberInfo bm) {\n    bm = pi == null ? default : new BindingMemberInfo(pi); return pi != null; }","tryCatchPattern":"try { var bm = new BindingMemberInfo(pi); }\ncatch (ArgumentNullException ex) when (ex.ParamName == \"propertyInfo\")\n{ /* reflection miss; log and skip member */ }","preventionTips":["Null-check reflection results before constructing.","Use nameof() to bind reflection strings to real members.","Fail at the reflection site with a clear message."],"tags":["cefsharp","model-binding","reflection","argument-validation","null-reference"],"backgroundTag":null,"analyzedSha":"16bc6e0711a4945be17e8bc4bc7ccf9469f3fdec","analyzedAt":"2026-08-13T19:57:05.828Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}