Skip to content

Commit

Permalink
Micrometer: ignore null suppliers
Browse files Browse the repository at this point in the history
(cherry picked from commit 5ec9bce)
  • Loading branch information
ebullient authored and geoand committed Sep 28, 2021
1 parent b60bf09 commit 18e15fe
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ void registerExtensionMetrics(MicrometerRecorder recorder,
// RootMeterRegistryBuildItem is present to indicate we call this after the root registry has been initialized

for (MetricsFactoryConsumerBuildItem item : metricsFactoryConsumerBuildItems) {
if (item.executionTime() == ExecutionTime.STATIC_INIT) {
if (item != null && item.executionTime() == ExecutionTime.STATIC_INIT) {
recorder.registerMetrics(item.getConsumer());
}
}
Expand All @@ -261,7 +261,7 @@ void configureRegistry(MicrometerRecorder recorder,
recorder.configureRegistries(config, typeClasses, shutdownContextBuildItem);

for (MetricsFactoryConsumerBuildItem item : metricsFactoryConsumerBuildItems) {
if (item.executionTime() == ExecutionTime.RUNTIME_INIT) {
if (item != null && item.executionTime() == ExecutionTime.RUNTIME_INIT) {
recorder.registerMetrics(item.getConsumer());
}
}
Expand Down

0 comments on commit 18e15fe

Please sign in to comment.