Skip to content

Commit

Permalink
Add missing callback error handling
Browse files Browse the repository at this point in the history
In queryPollDoc(), the callback for getCollectionPoll() does not have any error handling

Thus, when collection is undefined and an error is returned, we hit a TypeError when we try to call find() on collection
  • Loading branch information
jenwei authored May 12, 2020
1 parent 595f092 commit f6e6099
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,7 @@ ShareDbMongo.prototype.queryPoll = function(collectionName, inputQuery, options,
ShareDbMongo.prototype.queryPollDoc = function(collectionName, id, inputQuery, options, callback) {
var self = this;
self.getCollectionPoll(collectionName, function(err, collection) {
if (err) return callback(err);
var parsed = self._getSafeParsedQuery(inputQuery, callback);
if (!parsed) return;

Expand Down

0 comments on commit f6e6099

Please sign in to comment.