Skip to content

Commit ecf56f5

Browse files
author
Jason Separovic
committed
fix #1449 : check controllerMetadata is not null
1 parent fcc8aef commit ecf56f5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/kafkaClient.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ KafkaClient.prototype.getController = function (callback) {
279279
var controllerId = result[1].clusterMetadata.controllerId;
280280
var controllerMetadata = result[0][controllerId];
281281

282-
var broker = this.getBroker(controllerMetadata.host, controllerMetadata.port);
282+
broker = controllerMetadata ? this.getBroker(controllerMetadata.host, controllerMetadata.port) : null;
283283

284284
if (!broker || !broker.isConnected()) {
285285
this.refreshBrokerMetadata();

0 commit comments

Comments
 (0)