Skip to content

Commit ff63de2

Browse files
committed
Skip NULLs on parameter replacement process
1 parent e422dcf commit ff63de2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Orm/Xtensive.Orm/Orm/Internals/CompiledQueryRunner.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2012-2020 Xtensive LLC.
1+
// Copyright (C) 2012-2021 Xtensive LLC.
22
// This code is distributed under MIT license terms.
33
// See the License.txt file in the project root for more information.
44
// Created by: Denis Krjuchkov
@@ -156,6 +156,9 @@ private void AllocateParameterAndReplacer()
156156
queryParameter = (Parameter) System.Activator.CreateInstance(parameterType, "pClosure");
157157
queryParameterReplacer = new ExtendedExpressionReplacer(expression => {
158158
if (expression.NodeType == ExpressionType.Constant) {
159+
if ((expression as ConstantExpression).Value == null) {
160+
return null;
161+
}
159162
if (expression.Type.IsClosure()) {
160163
if (expression.Type == closureType) {
161164
return Expression.MakeMemberAccess(Expression.Constant(queryParameter, parameterType), valueMemberInfo);

0 commit comments

Comments
 (0)