From a6d0bab21ba414a676df4c674102d2b120559619 Mon Sep 17 00:00:00 2001 From: huip Date: Fri, 21 Jun 2019 17:12:18 +0800 Subject: [PATCH] Fixed bug when autoCommit arguments length equal 0 fixed when autoCommit function arguments.length = 0, the cb is not defined --- lib/consumer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/consumer.js b/lib/consumer.js index d85a7351..3e00d5fa 100644 --- a/lib/consumer.js +++ b/lib/consumer.js @@ -158,7 +158,7 @@ function autoCommit (force, cb) { force = false; } - if (this.committing && !force) return cb(null, 'Offset committing'); + if (this.committing && !force && cb) return cb(null, 'Offset committing'); this.committing = true; setTimeout(function () {