Merge pull request #409 from Alkarex/patch-1
[mono.git] / mcs / class / System.Xml.Linq / System.Xml.Linq / XElement.cs
index 7bd4e5635d4bf8fcc60d6ace2e52e50e1fa7a4a9..524324e47f1a341f4403bca6fafda1ebf48c3ea3 100644 (file)
@@ -52,12 +52,16 @@ namespace System.Xml.Linq
 
                public XElement (XName name, object content)
                {
+                       if (name == null)
+                               throw new ArgumentNullException ("name");
                        this.name = name;
                        Add (content);
                }
 
                public XElement (XElement other)
                {
+                       if (other == null)
+                               throw new ArgumentNullException ("other");
                        name = other.name;
                        Add (other.Attributes ());
                        Add (other.Nodes ());
@@ -65,17 +69,23 @@ namespace System.Xml.Linq
 
                public XElement (XName name)
                {
+                       if (name == null)
+                               throw new ArgumentNullException ("name");
                        this.name = name;
                }
 
                public XElement (XName name, params object [] content)
                {
+                       if (name == null)
+                               throw new ArgumentNullException ("name");
                        this.name = name;
                        Add (content);
                }
 
                public XElement (XStreamingElement other)
                {
+                       if (other == null)
+                               throw new ArgumentNullException ("other");
                        this.name = other.Name;
                        Add (other.Contents);
                }