File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
src/Simplify.Web.Postman/Assembly/Collection/PartBuilders Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,9 @@ private static string BuildRequestJsonData(Type modelType)
8383
8484 private static object CreateObject ( Type modelType )
8585 {
86+ if ( modelType == typeof ( string ) )
87+ return string . Empty ;
88+
8689 if ( IsGenericList ( modelType ) )
8790 modelType = ConstructGenericListTypeFromGenericIList ( modelType ) ;
8891
@@ -113,7 +116,7 @@ private static void InitializeListsSingleEmptyValues(object model)
113116 var emptyListType = ConstructGenericListTypeFromGenericIList ( propertyInfo . PropertyType ) ;
114117
115118 var emptyList = Activator . CreateInstance ( emptyListType ) ;
116- var emptyItem = Activator . CreateInstance ( listObjectType ) ;
119+ var emptyItem = CreateObject ( listObjectType ) ;
117120
118121 emptyListType . GetMethod ( "Add" ) ! . Invoke ( emptyList , [ emptyItem ] ) ;
119122
You can’t perform that action at this time.
0 commit comments