Skip to content

Commit ada4cd5

Browse files
authored
Fix credential NPE (#1955)
* fix #1565
1 parent a722e95 commit ada4cd5

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/GrpcLoggingRpc.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,12 @@ public GrpcLoggingRpc(LoggingOptions options) throws IOException {
8282
ChannelProvider channelProvider;
8383
// todo(mziccard): ChannelProvider should support null/absent credentials for testing
8484
if (options.getHost().contains("localhost")
85-
|| options.getCredentials().equals(NoCredentials.getInstance())) {
86-
ManagedChannel managedChannel = ManagedChannelBuilder.forTarget(options.getHost())
87-
.usePlaintext(true)
88-
.executor(executor)
89-
.build();
85+
|| NoCredentials.getInstance().equals(options.getCredentials())) {
86+
ManagedChannel managedChannel =
87+
ManagedChannelBuilder.forTarget(options.getHost())
88+
.usePlaintext(true)
89+
.executor(executor)
90+
.build();
9091
channelProvider = FixedChannelProvider.create(managedChannel);
9192
} else {
9293
channelProvider = GrpcTransportOptions.setUpChannelProvider(

0 commit comments

Comments
 (0)