ARTEMIS-4698 mitigate NPE when removing metrics
This commit is contained in:
parent
04f6424928
commit
f36e944641
|
@ -168,7 +168,11 @@ public class MetricsManager {
|
||||||
logger.debug("Unregistering meters for {}", resource);
|
logger.debug("Unregistering meters for {}", resource);
|
||||||
for (Meter meter : resourceMeters) {
|
for (Meter meter : resourceMeters) {
|
||||||
Meter removed = meterRegistry.remove(meter);
|
Meter removed = meterRegistry.remove(meter);
|
||||||
logger.debug("Unregistered meter: {}", removed.getId());
|
if (removed != null) {
|
||||||
|
logger.debug("Unregistered meter: {}", removed.getId());
|
||||||
|
} else {
|
||||||
|
logger.debug("Attempted to unregister meter {}, but it wasn't found in the registry", meter);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logger.debug("Attempted to unregister meters for {}, but none were found.", resource);
|
logger.debug("Attempted to unregister meters for {}, but none were found.", resource);
|
||||||
|
|
Loading…
Reference in New Issue