Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mcs/class/System.XML/System.Xml/XmlTextReader.cs9
1 files changed, 6 insertions, 3 deletions
diff --git a/mcs/class/System.XML/System.Xml/XmlTextReader.cs b/mcs/class/System.XML/System.Xml/XmlTextReader.cs
index ded97250cbb..b51eb6ff3dc 100644
--- a/mcs/class/System.XML/System.Xml/XmlTextReader.cs
+++ b/mcs/class/System.XML/System.Xml/XmlTextReader.cs
@@ -330,7 +330,8 @@ namespace System.Xml
public override string GetAttribute (string name)
{
- return attributes [name] as string;
+ return attributes.ContainsKey (name) ?
+ attributes [name] as string : String.Empty;
}
public override string GetAttribute (string localName, string namespaceURI)
@@ -349,10 +350,12 @@ namespace System.Xml
string thisNamespaceURI = LookupNamespace (thisPrefix);
if (namespaceURI == thisNamespaceURI)
- return attributes [thisName] as string;
+ return attributes.ContainsKey (thisName) ?
+ attributes [thisName] as string : String.Empty;
}
} else if (localName == "xmlns" && namespaceURI == "http://www.w3.org/2000/xmlns/" && thisName == "xmlns")
- return attributes [thisName] as string;
+ return attributes.ContainsKey (thisName) ?
+ attributes [thisName] as string : String.Empty;
}
return String.Empty;