Skip to content

Commit 9de5ffc

Browse files
committed
Deal with the multiplex-session .getOptions null returns in getChannel
1 parent ca7b46d commit 9de5ffc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionImpl.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,11 @@ int getChannel() {
600600
if (getIsMultiplexed()) {
601601
return 0;
602602
}
603-
Long channelHint = (Long) this.getOptions().get(SpannerRpc.Option.CHANNEL_HINT);
603+
Map<SpannerRpc.Option, ?> options = this.getOptions();
604+
if (options == null) {
605+
return 0;
606+
}
607+
Long channelHint = (Long) options.get(SpannerRpc.Option.CHANNEL_HINT);
604608
if (channelHint == null) {
605609
return 0;
606610
}

0 commit comments

Comments
 (0)