@@ -72,7 +72,6 @@ public static object ObjectStringToType(string strType)
72
72
73
73
public static Type ExtractType ( string strType )
74
74
{
75
- var typeAttrInObject = Serializer . TypeAttrInObject ;
76
75
if ( strType == null || strType . Length <= 1 ) return null ;
77
76
78
77
var hasWhitespace = JsonUtils . WhiteSpaceChars . Contains ( strType [ 1 ] ) ;
@@ -83,6 +82,7 @@ public static Type ExtractType(string strType)
83
82
strType = "{" + strType . Substring ( pos ) ;
84
83
}
85
84
85
+ var typeAttrInObject = Serializer . TypeAttrInObject ;
86
86
if ( strType . Length > typeAttrInObject . Length
87
87
&& strType . Substring ( 0 , typeAttrInObject . Length ) == typeAttrInObject )
88
88
{
@@ -234,10 +234,18 @@ internal class TypeAccessor
234
234
235
235
public static Type ExtractType ( ITypeSerializer Serializer , string strType )
236
236
{
237
- var typeAttrInObject = Serializer . TypeAttrInObject ;
237
+ if ( strType == null || strType . Length <= 1 ) return null ;
238
+
239
+ var hasWhitespace = JsonUtils . WhiteSpaceChars . Contains ( strType [ 1 ] ) ;
240
+ if ( hasWhitespace )
241
+ {
242
+ var pos = strType . IndexOf ( '"' ) ;
243
+ if ( pos >= 0 )
244
+ strType = "{" + strType . Substring ( pos ) ;
245
+ }
238
246
239
- if ( strType != null
240
- && strType . Length > typeAttrInObject . Length
247
+ var typeAttrInObject = Serializer . TypeAttrInObject ;
248
+ if ( strType . Length > typeAttrInObject . Length
241
249
&& strType . Substring ( 0 , typeAttrInObject . Length ) == typeAttrInObject )
242
250
{
243
251
var propIndex = typeAttrInObject . Length ;
0 commit comments