Skip to content

Commit c0e1bfd

Browse files
committed
check if okHttpClient is not null
1 parent 8aabb3c commit c0e1bfd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/java/com/litesoftwares/coingecko/CoinGeckoApi.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,10 @@ public <T> T executeSync(Call<T> call) {
6262
}
6363

6464
public void shutdown() {
65-
okHttpClient.dispatcher().executorService().shutdown();
66-
okHttpClient.connectionPool().evictAll();
65+
if (okHttpClient != null) {
66+
okHttpClient.dispatcher().executorService().shutdown();
67+
okHttpClient.connectionPool().evictAll();
68+
}
6769
}
6870

6971
private CoinGeckoApiError getCoinGeckoApiError(Response<?> response) throws IOException{

0 commit comments

Comments
 (0)