mirror of
https://github.com/correl/mage.git
synced 2024-12-26 11:09:27 +00:00
Improved CardCriteria to handle no selected color or card type without exception.
This commit is contained in:
parent
4b2e6a8bc0
commit
caa07069b4
1 changed files with 9 additions and 3 deletions
|
@ -256,11 +256,17 @@ public class CardCriteria {
|
|||
where.and(5);
|
||||
colorClauses++;
|
||||
}
|
||||
where.or(colorClauses);
|
||||
clausesCount++;
|
||||
if (colorClauses > 0) {
|
||||
where.or(colorClauses);
|
||||
clausesCount++;
|
||||
}
|
||||
}
|
||||
|
||||
where.and(clausesCount);
|
||||
if (clausesCount > 0) {
|
||||
where.and(clausesCount);
|
||||
} else {
|
||||
where.eq("cardNumber", new SelectArg(0));
|
||||
}
|
||||
|
||||
if (start != null) {
|
||||
qb.offset(start);
|
||||
|
|
Loading…
Reference in a new issue