{"record":{"id":"d8cc7ec25a23d074","repo":"unoplatform/uno","slug":"typenamelist","errorCode":null,"errorMessage":"typeNameList","messagePattern":"typeNameList","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"src/SourceGenerators/System.Xaml/System.Xaml.Schema/XamlTypeName.cs","lineNumber":114,"sourceCode":"\n\t\t\tresult = new XamlTypeName (ns, local, args);\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic static IList<XamlTypeName> ParseList (string typeNameList, IXamlNamespaceResolver namespaceResolver)\n\t\t{\n\t\t\tIList<XamlTypeName> list;\n\t\t\tif (!TryParseList (typeNameList, namespaceResolver, out list))\n\t\t\t\tthrow new FormatException (String.Format (CultureInfo.InvariantCulture, \"Invalid type name list: '{0}'\", typeNameList));\n\t\t\treturn list;\n\t\t}\n\n\t\tstatic readonly char [] comma_or_parens = new char [] {',', '(', ')'};\n\n\t\tpublic static bool TryParseList (string typeNameList, IXamlNamespaceResolver namespaceResolver, out IList<XamlTypeName> result)\n\t\t{\n\t\t\tif (typeNameList == null)\n\t\t\t\tthrow new ArgumentNullException (\"typeNameList\");\n\t\t\tif (namespaceResolver == null)\n\t\t\t\tthrow new ArgumentNullException (\"namespaceResolver\");\n\n\t\t\tresult = null;\n\t\t\tint idx = 0;\n\t\t\tint parens = 0;\n\t\t\tXamlTypeName tn;\n\n\t\t\tList<string> l = new List<string> ();\n\t\t\tint lastToken = 0;\n\t\t\twhile (true) {\n\t\t\t\tint i = typeNameList.IndexOfAny (comma_or_parens, idx);\n\t\t\t\tif (i < 0) {\n\t\t\t\t\tl.Add (typeNameList.Substring (lastToken));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tswitch (typeNameList [i]) {","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/unoplatform/uno/blob/04183404888ea21b4e5bfa3493e8d5f15e972c3a/src/SourceGenerators/System.Xaml/System.Xaml.Schema/XamlTypeName.cs#L96-L132","documentation":"Thrown by XamlTypeName.TryParseList when the `typeNameList` argument is null. The list parser tokenizes the input string by comma/paren, so a null string cannot be tokenized; it is rejected immediately rather than returning false.","triggerScenarios":"Calling XamlTypeName.TryParseList(null, resolver, out _); passing a null list string sourced from an absent attribute or an uninitialized variable.","commonSituations":"Optional config that omits a type-name list (null); deserialization feeding null into list parsing; refactors dropping the string.","solutions":["Null-check the input before calling TryParseList and treat null as an empty list in your flow.","Default the variable to string.Empty and let the parser produce an empty/single result.","Validate upstream sources of the list string for null."],"exampleFix":"// before\nXamlTypeName.TryParseList(listStr, resolver, out var list);\n\n// after\nif (listStr == null) { list = new List<XamlTypeName>(); return; }\nXamlTypeName.TryParseList(listStr, resolver, out list);","handlingStrategy":"validation","validationCode":"// before TryParseList\nif (typeNameList == null) { result = new List<XamlTypeName>(); return; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Null-check the list string before parsing.","Default optional list inputs to string.Empty rather than null."],"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"}