Skip to content

Commit 2ddaa89

Browse files
Merge pull request balderdashy#60 from Hiro-Nakamura/master
issue #59: verify result is valid before trying to use it.
2 parents 7ec14c7 + b3e18f0 commit 2ddaa89

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/adapter.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,8 @@ module.exports = (function() {
506506
return cb(null, resultArray);
507507
}
508508

509-
resultArray.push(result.insertId);
509+
// issue #59: verify result.insertId is valid
510+
if ((result) && (result.insertId)) resultArray.push(result.insertId);
510511
cb(err, resultArray);
511512
});
512513
}, dbs[collectionName].config, cb);

0 commit comments

Comments
 (0)