{"record":{"id":"0504da2141a157f3","repo":"unoplatform/uno","slug":"typename-0504da","errorCode":null,"errorMessage":"typeName","messagePattern":"typeName","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"src/SourceGenerators/System.Xaml/System.Xaml.Schema/XamlTypeName.cs","lineNumber":45,"sourceCode":"using System.Linq;\n\nnamespace Uno.Xaml.Schema\n{\n\t[UnconditionalSuppressMessage(\"Trimming\", \"IL2026\", Justification = \"Types manipulated here have been marked earlier\")]\n\tpublic class XamlTypeName\n\t{\n\t\tpublic static XamlTypeName Parse (string typeName, IXamlNamespaceResolver namespaceResolver)\n\t\t{\n\t\t\tXamlTypeName n;\n\t\t\tif (!TryParse (typeName, namespaceResolver, out n))\n\t\t\t\tthrow new FormatException (String.Format (CultureInfo.InvariantCulture, \"Invalid typeName: '{0}'\", typeName));\n\t\t\treturn n;\n\t\t}\n\n\t\tpublic static bool TryParse (string typeName, IXamlNamespaceResolver namespaceResolver, out XamlTypeName result)\n\t\t{\n\t\t\tif (typeName == null)\n\t\t\t\tthrow new ArgumentNullException (\"typeName\");\n\t\t\tif (namespaceResolver == null)\n\t\t\t\tthrow new ArgumentNullException (\"namespaceResolver\");\n\n\t\t\tresult = null;\n\t\t\tIList<XamlTypeName> args = null;\n\t\t\tint nArray = 0;\n\t\t\tint idx;\n\n\t\t\tif (typeName.Length > 2 && typeName [typeName.Length - 1] == ']') {\n\t\t\t\tidx = typeName.LastIndexOf ('[');\n\t\t\t\tif (idx < 0)\n\t\t\t\t\treturn false; // mismatch brace\n\t\t\t\tnArray = 1;\n\t\t\t\tfor (int i = idx + 1; i < typeName.Length - 1; i++) {\n\t\t\t\t\tif (typeName [i] != ',')\n\t\t\t\t\t\treturn false; // only ',' is expected\n\t\t\t\t\tnArray++;\n\t\t\t\t}","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/unoplatform/uno/blob/04183404888ea21b4e5bfa3493e8d5f15e972c3a/src/SourceGenerators/System.Xaml/System.Xaml.Schema/XamlTypeName.cs#L27-L63","documentation":"Thrown by XamlTypeName.TryParse when the `typeName` argument is null. TryParse is the core parser; a null input string has no characters to tokenize, so it rejects immediately rather than producing a misleading false return.","triggerScenarios":"Calling XamlTypeName.TryParse(null, resolver, out _); propagating a null type-name string from upstream (e.g. a missing attribute value, an empty element treated as a type reference).","commonSituations":"Config/code paths that read a type-name string from an optional attribute that was absent (null); deserialization feeding null into type resolution; unguarded string handling.","solutions":["Null-check the input before calling TryParse and treat null as 'no type' in your flow.","Provide a default/empty string and let TryParse return false instead.","Validate upstream sources of the type-name string to ensure they are non-null."],"exampleFix":"// before\nXamlTypeName.TryParse(typeNameStr, resolver, out var name);\n\n// after\nif (typeNameStr == null) { name = null; return; }\nXamlTypeName.TryParse(typeNameStr, resolver, out name);","handlingStrategy":"validation","validationCode":"// before TryParse\nif (typeName == null) { result = null; return; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Null-check input strings before parsing.","Treat a null type-name as 'no type specified' in your flow."],"tags":["xaml","schema","parsing","type-name","argument-validation"],"backgroundTag":null,"analyzedSha":"04183404888ea21b4e5bfa3493e8d5f15e972c3a","analyzedAt":"2026-08-13T21:08:11.651Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}