Skip to content

Commit b3f3eba

Browse files
Bouncheckavelanarius
authored andcommitted
Fix possible NullPointerException in Connection.shardId()
There is no need to call getShardingInfo() because when shardId is set to null getShardingInfo() is also null. Fixes #180.
1 parent 511573f commit b3f3eba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

driver-core/src/main/java/com/datastax/driver/core/Connection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,7 @@ boolean setOwner(Owner owner) {
10471047
}
10481048

10491049
public int shardId() {
1050-
return shardId == null || getHost().getShardingInfo() == null ? 0 : shardId;
1050+
return shardId == null ? 0 : shardId;
10511051
}
10521052

10531053
/**

0 commit comments

Comments
 (0)