Skip to content

Commit d70bc35

Browse files
committed
Avoid using DotvvmCollectionConverter for primitive types
1 parent 137a025 commit d70bc35

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Framework/Framework/ViewModel/Serialization/DotvvmCollectionConverter.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,13 @@ namespace DotVVM.Framework.ViewModel.Serialization
1919
public class DotvvmCollectionConverter : JsonConverterFactory
2020
{
2121
public override bool CanConvert(Type typeToConvert) =>
22-
IsCollection(typeToConvert); // && ReflectionUtils.IsPrimitiveType(ReflectionUtils.GetEnumerableType(typeToConvert) ?? typeof(object));
22+
IsCollection(typeToConvert) && !ReflectionUtils.IsPrimitiveType(ReflectionUtils.GetEnumerableType(typeToConvert) ?? typeof(object));
2323

2424
static bool IsAbstractType(Type type) =>
2525
type.IsAbstract || type == typeof(object);
2626

2727
static bool IsCollection(Type type)
2828
{
29-
// Only handle collections that we know how to populate
3029
if (type.IsArray && type.GetArrayRank() == 1)
3130
return true;
3231

0 commit comments

Comments
 (0)