Skip to content

Commit

Permalink
fix(node): fix nullpointer when trying to view cluster information in…
Browse files Browse the repository at this point in the history
… MSK Serverless (#1227)

close #1226

Co-authored-by: Ludovic DEHON <tchiot.ludo@gmail.com>
  • Loading branch information
moremagic and tchiotludo authored Nov 6, 2022
1 parent 9325de2 commit bb6a35e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/src/containers/Node/NodeList/NodesList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class NodesList extends Root {
id: JSON.stringify(node.id) || '',
host: `${node.host}:${node.port}` || '',
rack: node.rack || '',
controller: nodes.controller.id === node.id ? 'True' : 'False' || '',
controller: nodes.controller && nodes.controller.id === node.id ? 'True' : 'False' || '',
partition: undefined
};
});
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/org/akhq/models/Cluster.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.ExecutionException;

@ToString
Expand All @@ -25,6 +26,8 @@ public Cluster(DescribeClusterResult result) throws ExecutionException, Interrup
this.nodes.add(new Node(node));
}

this.controller = new Node(result.controller().get());
if (result.controller().get() != null) {
this.controller = new Node(result.controller().get());
}
}
}

0 comments on commit bb6a35e

Please sign in to comment.