Skip to content

Commit f6e6099

Browse files
authored
Add missing callback error handling
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
1 parent 595f092 commit f6e6099

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,7 @@ ShareDbMongo.prototype.queryPoll = function(collectionName, inputQuery, options,
829829
ShareDbMongo.prototype.queryPollDoc = function(collectionName, id, inputQuery, options, callback) {
830830
var self = this;
831831
self.getCollectionPoll(collectionName, function(err, collection) {
832+
if (err) return callback(err);
832833
var parsed = self._getSafeParsedQuery(inputQuery, callback);
833834
if (!parsed) return;
834835

0 commit comments

Comments
 (0)