Skip to content

Commit

Permalink
fix(core): Fix findAndGossip was not checking if group nodes length w…
Browse files Browse the repository at this point in the history
…as empty before picking node
  • Loading branch information
iamyellow authored and aholstenson committed May 27, 2022
1 parent af2bc17 commit df08fb4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/core/src/Gossiper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ export class Gossiper<V extends object> {

private findAndGossip() {
const nodes = this.group.nodes;
if(nodes.length === 0) {
return;
}
const idx = Math.floor(Math.random() * nodes.length);

const node = nodes[idx];
Expand Down

0 comments on commit df08fb4

Please sign in to comment.