{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/corefx/issues/41704","repository_url":"https://api.github.com/repos/dotnet/corefx","labels_url":"https://api.github.com/repos/dotnet/corefx/issues/41704/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/41704/comments","events_url":"https://api.github.com/repos/dotnet/corefx/issues/41704/events","html_url":"https://github.com/dotnet/corefx/issues/41704","id":505230198,"node_id":"MDU6SXNzdWU1MDUyMzAxOTg=","number":41704,"title":"XmlSchemaAnyAttribute.Namespace throws NRE when not set before","user":{"login":"martin-frydl","id":26817338,"node_id":"MDQ6VXNlcjI2ODE3MzM4","avatar_url":"https://avatars0.githubusercontent.com/u/26817338?v=4","gravatar_id":"","url":"https://api.github.com/users/martin-frydl","html_url":"https://github.com/martin-frydl","followers_url":"https://api.github.com/users/martin-frydl/followers","following_url":"https://api.github.com/users/martin-frydl/following{/other_user}","gists_url":"https://api.github.com/users/martin-frydl/gists{/gist_id}","starred_url":"https://api.github.com/users/martin-frydl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martin-frydl/subscriptions","organizations_url":"https://api.github.com/users/martin-frydl/orgs","repos_url":"https://api.github.com/users/martin-frydl/repos","events_url":"https://api.github.com/users/martin-frydl/events{/privacy}","received_events_url":"https://api.github.com/users/martin-frydl/received_events","type":"User","site_admin":false},"labels":[{"id":147576403,"node_id":"MDU6TGFiZWwxNDc1NzY0MDM=","url":"https://api.github.com/repos/dotnet/corefx/labels/area-System.Xml","name":"area-System.Xml","color":"d4c5f9","default":false},{"id":145399955,"node_id":"MDU6TGFiZWwxNDUzOTk5NTU=","url":"https://api.github.com/repos/dotnet/corefx/labels/bug","name":"bug","color":"207de5","default":true},{"id":181727851,"node_id":"MDU6TGFiZWwxODE3Mjc4NTE=","url":"https://api.github.com/repos/dotnet/corefx/labels/tenet-compatibility","name":"tenet-compatibility","color":"c2e0c6","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/dotnet/corefx/milestones/44","html_url":"https://github.com/dotnet/corefx/milestone/44","labels_url":"https://api.github.com/repos/dotnet/corefx/milestones/44/labels","id":4497552,"node_id":"MDk6TWlsZXN0b25lNDQ5NzU1Mg==","number":44,"title":"5.0","description":".NET Core 5.0, next major release after 3.x. See [official release dates](https://github.com/dotnet/core/blob/master/roadmap.md) for details.\r\n\r\nWe will move important issues from Future to 5.0 as the priorities and dates for next release become more clear.","creator":{"login":"karelz","id":5776068,"node_id":"MDQ6VXNlcjU3NzYwNjg=","avatar_url":"https://avatars2.githubusercontent.com/u/5776068?v=4","gravatar_id":"","url":"https://api.github.com/users/karelz","html_url":"https://github.com/karelz","followers_url":"https://api.github.com/users/karelz/followers","following_url":"https://api.github.com/users/karelz/following{/other_user}","gists_url":"https://api.github.com/users/karelz/gists{/gist_id}","starred_url":"https://api.github.com/users/karelz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karelz/subscriptions","organizations_url":"https://api.github.com/users/karelz/orgs","repos_url":"https://api.github.com/users/karelz/repos","events_url":"https://api.github.com/users/karelz/events{/privacy}","received_events_url":"https://api.github.com/users/karelz/received_events","type":"User","site_admin":false},"open_issues":1086,"closed_issues":914,"state":"open","created_at":"2019-07-16T23:15:36Z","updated_at":"2019-10-11T06:18:10Z","due_on":"2020-11-30T08:00:00Z","closed_at":null},"comments":2,"created_at":"2019-10-10T12:14:01Z","updated_at":"2019-10-11T09:18:52Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"When I have \"empty\" instance of XmlSchemaAnyAttribute and access Namespace property, it throws NullReferenceException. This is caused by commit 2c22af8903522e54f71225c40ddd383b15632ae0 which now calls NamespaceList.ToString().\r\n\r\nAccording to XML schema specification, namespace attribute is optional so it is valid to have it set to null. For example when I read XML schema with <xs:anyAttribute/>, .NET XML reader will create exactly the same instance - with null _ns field and also null NamespaceList. Later when I try to access the field, I get NRE. I get it also when I try to save schema back to serialized form. This time the exception is thrown from serialization due to optimization - the line of code in XmlSchemaAnyAttribute is not visible in exception stack trace.\r\n\r\nHow to reproduce:\r\nvar x = new XmlSchemaAnyAttribute().Namespace;"},"comment":{"url":"https://api.github.com/repos/dotnet/corefx/issues/comments/540987021","html_url":"https://github.com/dotnet/corefx/issues/41704#issuecomment-540987021","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/41704","id":540987021,"node_id":"MDEyOklzc3VlQ29tbWVudDU0MDk4NzAyMQ==","user":{"login":"pavelchuchma","id":20964040,"node_id":"MDQ6VXNlcjIwOTY0MDQw","avatar_url":"https://avatars3.githubusercontent.com/u/20964040?v=4","gravatar_id":"","url":"https://api.github.com/users/pavelchuchma","html_url":"https://github.com/pavelchuchma","followers_url":"https://api.github.com/users/pavelchuchma/followers","following_url":"https://api.github.com/users/pavelchuchma/following{/other_user}","gists_url":"https://api.github.com/users/pavelchuchma/gists{/gist_id}","starred_url":"https://api.github.com/users/pavelchuchma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pavelchuchma/subscriptions","organizations_url":"https://api.github.com/users/pavelchuchma/orgs","repos_url":"https://api.github.com/users/pavelchuchma/repos","events_url":"https://api.github.com/users/pavelchuchma/events{/privacy}","received_events_url":"https://api.github.com/users/pavelchuchma/received_events","type":"User","site_admin":false},"created_at":"2019-10-11T09:18:52Z","updated_at":"2019-10-11T09:18:52Z","author_association":"NONE","body":"@krwq: Does targeting to 5.0 milestone mean that the fix will not be available before version 5.0 in November 2020? \r\nIt is a broken functionality in v3.0.0-preview6.19303.8. It was fine in previous versions, including 2.x. Our product loads and saves user defined schemas and it fails on any complex type definition with `<xs:anyAttribute />` now.\r\n\r\nTargeting this \"one character fix\" to an earlier 3.x patch will be very helpful.\r\n\r\nProposed fix of `XmlSchemaAnyAttribute.Namespace` property getter is:\r\n```\r\n- get { return _ns ?? NamespaceList.ToString(); }\r\n+ get { return _ns ?? NamespaceList.?ToString(); }\r\n```\r\n"}}
{"actor":{"display_login":"pavelchuchma"}}