From 5a55c8f2156ea2414036915cb01edfefb41b4ee4 Mon Sep 17 00:00:00 2001 From: Jan Dupej Date: Tue, 1 Oct 2024 11:14:27 +0200 Subject: [PATCH] Fix compatibility with net9.0 --- cs/src/core/expressions/DeserializerTransform.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cs/src/core/expressions/DeserializerTransform.cs b/cs/src/core/expressions/DeserializerTransform.cs index b89e1dfbb..8d7feab03 100644 --- a/cs/src/core/expressions/DeserializerTransform.cs +++ b/cs/src/core/expressions/DeserializerTransform.cs @@ -523,7 +523,7 @@ Expression Container(IParser parser, Expression container, Type schemaType, bool else { var capacity = container.Type.GetDeclaredProperty("Capacity", count.Type); - if (capacity != null) + if (capacity != null && capacity.CanWrite) { var cappedCount = Expression.Variable(typeof(int), container + "_count"); beforeLoop = ApplyCountCap(