2009-08-17 Atsushi Enomoto <atsushi@ximian.com>
authorAtsushi Eno <atsushieno@gmail.com>
Mon, 17 Aug 2009 08:36:05 +0000 (08:36 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Mon, 17 Aug 2009 08:36:05 +0000 (08:36 -0000)
* MessageHeaders.cs : when the value is null, do not try to
  deserialize EndpointAddress.

svn path=/trunk/mcs/; revision=140042

mcs/class/System.ServiceModel/System.ServiceModel.Channels/ChangeLog
mcs/class/System.ServiceModel/System.ServiceModel.Channels/MessageHeaders.cs

index d86b92277c82008cc451b4b5218df93402551aac..dc95b047c653de8b0a456fda7db544a05eb57c40 100755 (executable)
@@ -1,3 +1,8 @@
+2009-08-17  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * MessageHeaders.cs : when the value is null, do not try to
+         deserialize EndpointAddress.
+
 2009-08-17  Atsushi Enomoto  <atsushi@ximian.com>
 
         * MessageHeader.cs : add Value property. (Forgot dependent change.)
index c38cdea9ba6c349c9075f54299d8b58f8805954a..902f180ac9b5e891c5880c61b3ffe61d08e13cf5 100644 (file)
@@ -164,7 +164,7 @@ namespace System.ServiceModel.Channels
                                return (T) dmh.Value;
                        if (typeof (T) == typeof (EndpointAddress)) {
                                XmlDictionaryReader r = GetReaderAtHeader (index);
-                               return (T) (object) new EndpointAddress (r.ReadElementContentAsString ());
+                               return r.NodeType != XmlNodeType.Element ? default (T) : (T) (object) new EndpointAddress (r.ReadElementContentAsString ());
                        }
                        else
                                return GetHeader<T> (index, GetSerializer<T> (index));