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 gsmet committed Dec 1, 2021
1 parent d87e0f5 commit 3bc7c73
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 3bc7c73

Please sign in to comment.