Permalink
Browse files

Further protection against nulls.

  • Loading branch information...
1 parent 8ccb9a2 commit 7ab8be6bfcb944aa0224b1d70d4a0b1c74b320f8 @JoshuaGross committed Nov 28, 2012
Showing with 3 additions and 3 deletions.
  1. +2 −2 lib/mongoose-subpopulate.js
  2. +1 −1 package.json
@@ -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
@@ -1,6 +1,6 @@
{
"name": "mongoose-subpopulate",
- "version": "0.1.14",
+ "version": "0.1.15",
"main": "./lib/mongoose-subpopulate.js",
"scripts": {},
"repository": {

0 comments on commit 7ab8be6

Please sign in to comment.