runtime icon indicating copy to clipboard operation
runtime copied to clipboard

Add null checks in various XML methods

Open krwq opened this issue 3 years ago • 5 comments

Fixes https://github.com/dotnet/runtime/issues/41061

krwq avatar Aug 02 '22 16:08 krwq

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:

area-System.Xml

Milestone: -

msftbot[bot] avatar Aug 02 '22 16:08 msftbot[bot]

no changes, just rebase

krwq avatar Aug 07 '22 15:08 krwq

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

krwq avatar Aug 07 '22 19:08 krwq

Any of these worth a breaking change note? (I'm guessing not)

danmoseley avatar Aug 07 '22 19:08 danmoseley

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.

krwq avatar Aug 07 '22 21:08 krwq