Skip to content

Commit

Permalink
fix: use proper callback param
Browse files Browse the repository at this point in the history
  • Loading branch information
martijnimhoff committed Mar 25, 2024
1 parent 067755e commit 95c02dc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/kafka-consumer.js
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,9 @@ KafkaConsumer.prototype.consume = function(number, topic, partition, cb) {
}

this._consumeNumOfPartition(timeoutMs, number, topic, partition, cb);
} else if ((number && typeof number === 'number') || (number && cb)) {
} else if ((number && typeof number === 'number') || (number && topic)) {
// topic is given as the cb
cb = topic;

if (cb === undefined) {
cb = function() {};
Expand Down

0 comments on commit 95c02dc

Please sign in to comment.