forms-angular 0.12.0-beta.253 → 0.12.0-beta.254

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1031,17 +1031,19 @@ class FormsAngular {
1031
1031
  // Push the $unwind, add our own findFunc, and increment the pipelineStage counter
1032
1032
  retVal.push(array[pipelineSection + 1]);
1033
1033
  let lookedUpFindQry = await this.doFindFuncPromise(req, resource);
1034
- // Now we need to put the lookup base into the criteria
1035
- for (const prop in lookedUpFindQry) {
1036
- if (lookedUpFindQry.hasOwnProperty(prop)) {
1037
- lookedUpFindQry[`${lookupField}.${prop}`] = lookedUpFindQry[prop];
1038
- delete lookedUpFindQry[prop];
1034
+ if (lookedUpFindQry) {
1035
+ // Now we need to put the lookup base into the criteria
1036
+ for (const prop in lookedUpFindQry) {
1037
+ if (lookedUpFindQry.hasOwnProperty(prop)) {
1038
+ lookedUpFindQry[`${lookupField}.${prop}`] = lookedUpFindQry[prop];
1039
+ delete lookedUpFindQry[prop];
1040
+ }
1039
1041
  }
1042
+ if (allowNulls) {
1043
+ lookedUpFindQry = { $or: [lookedUpFindQry, { [lookupField]: { $exists: false } }] };
1044
+ }
1045
+ retVal.push({ $match: lookedUpFindQry });
1040
1046
  }
1041
- if (allowNulls) {
1042
- lookedUpFindQry = { $or: [lookedUpFindQry, { [lookupField]: { $exists: false } }] };
1043
- }
1044
- retVal.push({ $match: lookedUpFindQry });
1045
1047
  pipelineSection++;
1046
1048
  }
1047
1049
  }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "author": "Mark Chapman <support@forms-angular.org>",
4
4
  "description": "A form builder that sits on top of Angular.js, Twitter Bootstrap, jQuery UI, Angular-UI, Express and Mongoose. Opinionated or what?",
5
5
  "homepage": "http://forms-angular.org",
6
- "version": "0.12.0-beta.253",
6
+ "version": "0.12.0-beta.254",
7
7
  "engines": {
8
8
  "node": ">=8.x",
9
9
  "npm": ">=5.x"