Check the filter param to make sure we have a default value
sls-sample-app is failing if we hit http://localhost:3000/locations/findOne In this case, a undefined param is passed in. The fix now sets it to {} if the value is undefined/null
This commit is contained in:
parent
be10dfcc18
commit
21e6fddf1a
|
@ -469,6 +469,7 @@ DataAccessObject.findOne = function findOne(params, cb) {
|
||||||
cb = params;
|
cb = params;
|
||||||
params = {};
|
params = {};
|
||||||
}
|
}
|
||||||
|
params = params || {};
|
||||||
params.limit = 1;
|
params.limit = 1;
|
||||||
this.find(params, function (err, collection) {
|
this.find(params, function (err, collection) {
|
||||||
if (err || !collection || !collection.length > 0) return cb(err, null);
|
if (err || !collection || !collection.length > 0) return cb(err, null);
|
||||||
|
|
Loading…
Reference in New Issue