Browse Source

fix(nocodb): cater undefined aliasColObjMap[alias]

pull/5185/head
Wing-Kam Wong 2 years ago
parent
commit
b001bae5f4
  1. 6
      packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/BaseModelSqlv2.ts

6
packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/BaseModelSqlv2.ts

@ -3020,7 +3020,10 @@ function extractCondition(nestedArrayConditions, aliasColObjMap) {
str.match(/(?:~(and|or|not))?\((.*?),(\w+),(.*)\)/)?.slice(1) || [];
let sub_op = null;
if ([UITypes.Date, UITypes.DateTime].includes(aliasColObjMap[alias].uidt)) {
if (aliasColObjMap[alias]) {
if (
[UITypes.Date, UITypes.DateTime].includes(aliasColObjMap[alias].uidt)
) {
value = value.split(',');
// the first element would be sub_op
sub_op = value[0];
@ -3031,6 +3034,7 @@ function extractCondition(nestedArrayConditions, aliasColObjMap) {
}
validateFilterComparison(aliasColObjMap[alias].uidt, op, sub_op);
}
return new Filter({
comparison_op: op,

Loading…
Cancel
Save