Skip to content

Commit

Permalink
fix #1449 : check controllerMetadata is not null
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Separovic committed Jun 28, 2021
1 parent fcc8aef commit 2f82437
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/kafkaClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ KafkaClient.prototype.getController = function (callback) {
var controllerId = result[1].clusterMetadata.controllerId;
var controllerMetadata = result[0][controllerId];

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

if (!broker || !broker.isConnected()) {
this.refreshBrokerMetadata();
Expand Down

0 comments on commit 2f82437

Please sign in to comment.