Browse Source
If findAndModify experiences an error, the obj argument to the callback is undefined. Instead the lastErrorObject is attached to the err argument, from where we extract it. To not rely on the lastErrorObject ALWAYS being on the err object if provided, we gracefully fall back to looking in the obj object and then finally just return { n: 0 } if no lastErrorObject is found. This could be a more strict algorihm, but this seems more future-proof.saintedlama/travis-non-legacy
Thomas Watson Steen
11 years ago
2 changed files with 14 additions and 2 deletions
Loading…
Reference in new issue