Skip to content

Commit b402985

Browse files
authored
[improve][client] Prevent NullPointException when closing ClientCredentialsFlow (#24123)
1 parent d0c996e commit b402985

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)