From 64631e0bdc2969776526bcc2411139b250ea6bb8 Mon Sep 17 00:00:00 2001 From: Aleksandr Korchak Date: Tue, 24 Mar 2026 20:03:38 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20FindArrayInClosure=20=E2=80=94=20search?= =?UTF-8?q?=20plain=20objects=20in=20object[]=20(display=20class=20pattern?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closure.Constants can contain a plain <>c__DisplayClass holding the array, not only a Delegate. Recurse into any non-null item, not just Delegate.Target. --- Mindbox.Data.Linq/Mindbox.Data.Linq.csproj | 2 +- Mindbox.Data.Linq/SqlClient/Query/QueryConverter.cs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Mindbox.Data.Linq/Mindbox.Data.Linq.csproj b/Mindbox.Data.Linq/Mindbox.Data.Linq.csproj index fc5788e..df1aeb4 100644 --- a/Mindbox.Data.Linq/Mindbox.Data.Linq.csproj +++ b/Mindbox.Data.Linq/Mindbox.Data.Linq.csproj @@ -8,7 +8,7 @@ true true snupkg - 10.8.1$(VersionTag) + 10.8.2$(VersionTag) SYSLIB0003;SYSLIB0011 diff --git a/Mindbox.Data.Linq/SqlClient/Query/QueryConverter.cs b/Mindbox.Data.Linq/SqlClient/Query/QueryConverter.cs index 557a3a2..0973c75 100644 --- a/Mindbox.Data.Linq/SqlClient/Query/QueryConverter.cs +++ b/Mindbox.Data.Linq/SqlClient/Query/QueryConverter.cs @@ -1793,8 +1793,9 @@ private static object FindArrayInClosure(object target, Type arrayType, int dept if (item?.GetType() == arrayType) { return item; } - if (item is Delegate nested && nested.Target != null) { - var found = FindArrayInClosure(nested.Target, arrayType, depth + 1); + var searchTarget = item is Delegate nested ? nested.Target : item; + if (searchTarget != null) { + var found = FindArrayInClosure(searchTarget, arrayType, depth + 1); if (found != null) { return found; }