Skip to content

Commit

Permalink
Fix possible NullPointerException in Connection.shardId()
Browse files Browse the repository at this point in the history
There is no need to call getShardingInfo() because when shardId is set to null
getShardingInfo() is also null.

Fixes #180.
  • Loading branch information
Bouncheck authored and avelanarius committed Feb 20, 2023
1 parent 511573f commit b3f3eba
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1047,7 +1047,7 @@ boolean setOwner(Owner owner) {
}

public int shardId() {
return shardId == null || getHost().getShardingInfo() == null ? 0 : shardId;
return shardId == null ? 0 : shardId;
}

/**
Expand Down

0 comments on commit b3f3eba

Please sign in to comment.