XNodeReader.GetAttribute(int) should throw on invalid indices #44287
Labels
area-System.Xml
good first issue
Issue should be easy to implement, good for first-time contributors
Milestone
Note: this class is internal but this method is accessible through XmlReader's public surface which can be created with i.e. XNode.CreateReader.
All XmlReader implementations except XNodeReader throw ArgumentOutOfRangeException on invalid indices. This specific class returns null though. Documentation of XmlReader says that ArgumentOutOfRange is expected behavior.
Also same method returns null when reader state is not in interactive mode - likely this should be replaced with InvalidOperationException.
Found with nullable annotations.
The text was updated successfully, but these errors were encountered: