diff options
Diffstat (limited to 'src/DotNetOAuth/Messaging/DictionaryXmlReader.cs')
-rw-r--r-- | src/DotNetOAuth/Messaging/DictionaryXmlReader.cs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/DotNetOAuth/Messaging/DictionaryXmlReader.cs b/src/DotNetOAuth/Messaging/DictionaryXmlReader.cs index 5eae4c7..7a5dc21 100644 --- a/src/DotNetOAuth/Messaging/DictionaryXmlReader.cs +++ b/src/DotNetOAuth/Messaging/DictionaryXmlReader.cs @@ -24,6 +24,9 @@ namespace DotNetOAuth.Messaging { /// <param name="fields">The dictionary to read data from.</param>
/// <returns>The XmlReader that will read the data out of the given dictionary.</returns>
internal static XmlReader Create(XName rootElement, IDictionary<string, string> fields) {
+ if (rootElement == null) {
+ throw new ArgumentNullException("rootElement");
+ }
if (fields == null) {
throw new ArgumentNullException("fields");
}
@@ -38,6 +41,10 @@ namespace DotNetOAuth.Messaging { /// <param name="fields">The dictionary to list values from.</param>
/// <returns>The generated <see cref="XmlReader"/>.</returns>
private static XmlReader CreateRoundtripReader(XName rootElement, IDictionary<string, string> fields) {
+ if (rootElement == null) {
+ throw new ArgumentNullException("rootElement");
+ }
+
MemoryStream stream = new MemoryStream();
XmlWriter writer = XmlWriter.Create(stream);
SerializeDictionaryToXml(writer, rootElement, fields);
@@ -62,6 +69,9 @@ namespace DotNetOAuth.Messaging { if (writer == null) {
throw new ArgumentNullException("writer");
}
+ if (rootElement == null) {
+ throw new ArgumentNullException("rootElement");
+ }
if (fields == null) {
throw new ArgumentNullException("fields");
}
|