Add null-check on 'partDesc'. Fix bug #612 (WCF regression)
authorSebastien Pouliot <sebastien@xamarin.com>
Wed, 7 Sep 2011 15:16:23 +0000 (11:16 -0400)
committerSebastien Pouliot <sebastien@xamarin.com>
Wed, 7 Sep 2011 15:16:23 +0000 (11:16 -0400)
mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/XmlMessagesFormatter.cs

index 859dacabe687e0033579e31762b36f99bce85cbe..9c1df61310afc8a0a3fa858179fe59bc55847ea4 100644 (file)
@@ -7,6 +7,7 @@
 //
 // Copyright (C) 2005-2010 Novell, Inc.  http://www.novell.com
 // Copyright (C) 2008 Mainsoft Co. http://www.mainsoft.com
+// Copyright (C) 2011 Xamarin Inc. http://www.xamarin.com
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -65,7 +66,7 @@ namespace System.ServiceModel.Dispatcher
                        m.IsReturnValue = isReturnValue;
                        m.MemberName = partDesc.Name;
                        m.MemberType = partDesc.Type;
-                       m.XmlAttributes = new XmlAttributes(partDesc.MemberInfo);
+                       m.XmlAttributes = partDesc.MemberInfo == null ? new XmlAttributes () : new XmlAttributes (partDesc.MemberInfo);
                        return m;
                }