Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Further protection against nulls.

  • Loading branch information...
commit 7ab8be6bfcb944aa0224b1d70d4a0b1c74b320f8 1 parent 8ccb9a2
@JoshuaGross authored
Showing with 3 additions and 3 deletions.
  1. +2 −2 lib/mongoose-subpopulate.js
  2. +1 −1  package.json
View
4 lib/mongoose-subpopulate.js
@@ -454,8 +454,8 @@ function wrapModelObject (object, cacheData, callback) {
}
var referencedObject = wrappedObject[i];
- if ('undefined' !== typeof referencedObject && 'null' !== typeof referencedObject) {
- if (referencedObject.getBare) {
+ if ('undefined' !== typeof referencedObject) {
+ if (referencedObject && referencedObject.getBare) {
referencedObject.getBare(subfields, function (err, dict) {
bareDictionary[i] = dict;
iter(null);
View
2  package.json
@@ -1,6 +1,6 @@
{
"name": "mongoose-subpopulate",
- "version": "0.1.14",
+ "version": "0.1.15",
"main": "./lib/mongoose-subpopulate.js",
"scripts": {},
"repository": {
Please sign in to comment.
Something went wrong with that request. Please try again.