mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
[Fixes #7003] Fixing NRE
This commit is contained in:
committed by
Sébastien Ros
parent
35c379191e
commit
dcc63228e5
@@ -69,6 +69,8 @@ namespace Orchard.Projections.FilterEditors.Forms {
|
|||||||
case StringOperator.Contains:
|
case StringOperator.Contains:
|
||||||
return x => x.Like(property, Convert.ToString(value), HqlMatchMode.Anywhere);
|
return x => x.Like(property, Convert.ToString(value), HqlMatchMode.Anywhere);
|
||||||
case StringOperator.ContainsAny:
|
case StringOperator.ContainsAny:
|
||||||
|
if (string.IsNullOrEmpty((string)value))
|
||||||
|
return x => x.Eq("Id", "0");
|
||||||
var values1 = Convert.ToString(value).Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
|
var values1 = Convert.ToString(value).Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
|
||||||
var predicates1 = values1.Skip(1).Select<string, Action<IHqlExpressionFactory>>(x => y => y.Like(property, x, HqlMatchMode.Anywhere)).ToArray();
|
var predicates1 = values1.Skip(1).Select<string, Action<IHqlExpressionFactory>>(x => y => y.Like(property, x, HqlMatchMode.Anywhere)).ToArray();
|
||||||
return x => x.Disjunction(y => y.Like(property, values1[0], HqlMatchMode.Anywhere), predicates1);
|
return x => x.Disjunction(y => y.Like(property, values1[0], HqlMatchMode.Anywhere), predicates1);
|
||||||
|
|||||||
Reference in New Issue
Block a user