Add null check to cleanup to avoid NPE (#11340)

This commit is contained in:
Larry Safran 2024-06-27 14:08:05 -07:00 committed by GitHub
parent 25a8b7c507
commit 603033f1fa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -308,7 +308,9 @@ public class StressTestClient {
} }
try { try {
metricsServer.shutdownNow(); if (metricsServer != null) {
metricsServer.shutdownNow();
}
} catch (Throwable t) { } catch (Throwable t) {
log.log(Level.WARNING, "Error shutting down metrics service!", t); log.log(Level.WARNING, "Error shutting down metrics service!", t);
} }