Skip to content

Commit 373596b

Browse files
fixed: null pointer in gossiping
1 parent 415ab77 commit 373596b

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/main/java/Server/ServerState.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,9 @@ public void setSmallPartitionFormed(boolean smallPartitionFormed) {
245245
}
246246

247247
public boolean amITheLeader() {
248+
if (currentLeader == null) {
249+
return false;
250+
}
248251
return serverId.equals(currentLeader.getId());
249252
}
250253

0 commit comments

Comments
 (0)