Skip to content

Commit

Permalink
fixed possible null pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
mafintosh committed Jun 23, 2011
1 parent aacfb51 commit 3a40661
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var normalizeId = function() {
};
}
return function(args) {
if (typeof args[0] === 'object' && typeof args[0]._id === 'string') {
if (args[0] && typeof args[0] === 'object' && typeof args[0]._id === 'string') {
args[0]._id = new mongo.BSONNative.ObjectID(args[0]._id);
}
return args;
Expand Down

0 comments on commit 3a40661

Please sign in to comment.