Skip to content

Commit 8d9ae13

Browse files
committed
[improve][client] Prevent NullPointException when closing ClientCredentialsFlow (apache#24123)
(cherry picked from commit b402985)
1 parent c4ecefe commit 8d9ae13

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pulsar-client/src/main/java/org/apache/pulsar/client/impl/auth/oauth2/ClientCredentialsFlow.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ public TokenResult authenticate() throws PulsarClientException {
109109

110110
@Override
111111
public void close() throws Exception {
112-
exchanger.close();
112+
if (exchanger != null) {
113+
exchanger.close();
114+
}
113115
}
114116

115117
/**

0 commit comments

Comments
 (0)