From 18e15fefc2b148948f9365ae931ac7d119bd3ba0 Mon Sep 17 00:00:00 2001 From: Erin Schnabel Date: Thu, 23 Sep 2021 17:22:47 -0400 Subject: [PATCH] Micrometer: ignore null suppliers (cherry picked from commit 5ec9bcebeb9df1cf35c1be0b4c30a53b749a8b8c) --- .../io/quarkus/micrometer/deployment/MicrometerProcessor.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/micrometer/deployment/src/main/java/io/quarkus/micrometer/deployment/MicrometerProcessor.java b/extensions/micrometer/deployment/src/main/java/io/quarkus/micrometer/deployment/MicrometerProcessor.java index cc01bcb212cc4..8e058dcfc9dc8 100644 --- a/extensions/micrometer/deployment/src/main/java/io/quarkus/micrometer/deployment/MicrometerProcessor.java +++ b/extensions/micrometer/deployment/src/main/java/io/quarkus/micrometer/deployment/MicrometerProcessor.java @@ -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()); } } @@ -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()); } }