Add null checks in various XML methods
Fixes https://github.com/dotnet/runtime/issues/41061
Tagging subscribers to this area: @dotnet/area-system-xml See info in area-owners.md if you want to be subscribed.
Issue Details
Fixes https://github.com/dotnet/runtime/issues/41061
| Author: | krwq |
|---|---|
| Assignees: | - |
| Labels: |
|
| Milestone: | - |
no changes, just rebase
Seems there was a test failure where we for some reason expected InvalidOperationException for null argument (with completely useless error message and NullRef on the inner exception), see here for more details: https://github.com/dotnet/runtime/pull/73243#discussion_r939709955 - I went ahead and removed this (since I already added test asserting ArgumentNullException) - I don't expect any particular impact from this change since it only happens for null arguments which suggests design error rather than something which app could potentially catch - makes more sense to throw more useful error message. Also now we match the behavior written in docs
Any of these worth a breaking change note? (I'm guessing not)
I don't think so, we're now matching behavior to already documented behavior and this exception seems very unlikely to be found by random input - most likely will be only seen during app-design time by developer.