[S.R.Serialization] fix nullable serialization to match referencesource codegen.
[mono.git] / mcs / class / System.Runtime.Serialization / ReferenceSources / XmlFormatReaderGenerator_static.cs
index 1f2c484749932ba0349aebe31a5f38b9dc1b66fd..8b81beca399e62f21b64d824c95c92319eea01eb 100644 (file)
@@ -300,7 +300,7 @@ namespace System.Runtime.Serialization
                 if (objectId == Globals.NullObjectId) {
                                        
                                        if (nullables != 0)
-                                               value = FormatterServices.GetUninitializedObject (valueType);
+                                               value = Activator.CreateInstance (valueType);
                                        else if (type.IsValueType)
                                                throw new SerializationException (SR.GetString (SR.ValueTypeCannotBeNull, DataContract.GetClrTypeFullName (type)));
                                        else