{"record":{"id":"448f831160c83294","repo":"dotnet/wpf","slug":"styluspointpropertyinfo","errorCode":null,"errorMessage":"stylusPointPropertyInfo","messagePattern":"stylusPointPropertyInfo","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Input/Stylus/Common/StylusPointPropertyInfo.cs","lineNumber":111,"sourceCode":"            internal set { _resolution = value; }\n        }\n\n        /// <summary>\n        /// Unit\n        /// </summary>\n        public StylusPointPropertyUnit Unit\n        {\n            get { return _unit; }\n        }\n\n        /// <summary>\n        /// Internal helper method for comparing compat for two StylusPointPropertyInfos\n        /// </summary>\n        internal static bool AreCompatible(StylusPointPropertyInfo stylusPointPropertyInfo1, StylusPointPropertyInfo stylusPointPropertyInfo2)\n        {\n            if (stylusPointPropertyInfo1 == null || stylusPointPropertyInfo2 == null)\n            {\n                throw new ArgumentNullException(\"stylusPointPropertyInfo\");\n            }\n\n            Debug.Assert((  stylusPointPropertyInfo1.Id != StylusPointPropertyIds.X &&\n                            stylusPointPropertyInfo1.Id != StylusPointPropertyIds.Y &&\n                            stylusPointPropertyInfo2.Id != StylusPointPropertyIds.X &&\n                            stylusPointPropertyInfo2.Id != StylusPointPropertyIds.Y),\n                            \"Why are you checking X, Y for compatibility?  They're always compatible\");\n            //\n            // we only take ID and IsButton into account, we don't take metrics into account\n            //\n            return (stylusPointPropertyInfo1.Id == stylusPointPropertyInfo2.Id &&\n                    stylusPointPropertyInfo1.IsButton == stylusPointPropertyInfo2.IsButton);\n        }\n    }\n}\n","sourceCodeStart":93,"sourceCodeEnd":127,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Input/Stylus/Common/StylusPointPropertyInfo.cs#L93-L127","documentation":"The internal static StylusPointPropertyInfo.AreCompatible method throws ArgumentNullException (with the legacy string literal 'stylusPointPropertyInfo') when either of the two info arguments is null. Both arguments are required to compare property compatibility.","triggerScenarios":"Invoking AreCompatible internally (e.g. from StylusPointDescription comparison paths) with a null first or second StylusPointPropertyInfo.","commonSituations":"Custom stylus property tables containing null entries; code that builds property info arrays lazily and passes uninitialized slots into description-compat checks.","solutions":["Ensure both StylusPointPropertyInfo instances are created before calling comparison code","Filter nulls out of property info collections before compat checks","Wrap the call and supply default property info (StylusPointPropertyInfoDefaults) for missing entries"],"exampleFix":"// before\nbool ok = StylusPointPropertyInfo.AreCompatible(info1, info2); // info2 may be null\n// after\nbool ok = info1 != null && info2 != null && StylusPointPropertyInfo.AreCompatible(info1, info2);","handlingStrategy":"type-guard","validationCode":"if (info1 == null || info2 == null) return false; // or substitute defaults","typeGuard":"static bool IsNonNull(StylusPointPropertyInfo i) => i != null;","tryCatchPattern":"try { bool ok = StylusPointPropertyInfo.AreCompatible(a, b); }\ncatch (ArgumentNullException) { /* handle missing property info */ }","preventionTips":["Fully populate property info collections before comparisons","Use StylusPointPropertyInfoDefaults for absent properties"],"tags":["wpf","stylus","null-argument"],"backgroundTag":"null-argument","analyzedSha":"81131a70a4c573cd62748a5c36908fc4d662daa9","analyzedAt":"2026-09-14T10:12:48.479Z","contentChangedAt":"2026-09-14T10:12:48.479Z","schemaVersion":2},"datasetVersion":"2026-09-21T21:30:21.729Z"}