From f10b608be6387a2feb12c4f845f3520222f3b1ec Mon Sep 17 00:00:00 2001 From: kevinten <596823919@qq.com> Date: Tue, 7 Dec 2021 21:59:12 +0800 Subject: [PATCH] feat: Mixer lazy load --- .../group/rxcloud/capa/infrastructure/hook/Mixer.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sdk-infrastructure/src/main/java/group/rxcloud/capa/infrastructure/hook/Mixer.java b/sdk-infrastructure/src/main/java/group/rxcloud/capa/infrastructure/hook/Mixer.java index 85cc2d5..c5c7b85 100644 --- a/sdk-infrastructure/src/main/java/group/rxcloud/capa/infrastructure/hook/Mixer.java +++ b/sdk-infrastructure/src/main/java/group/rxcloud/capa/infrastructure/hook/Mixer.java @@ -102,7 +102,9 @@ public static ConfigurationHooks configurationHooks() { * @return the configuration hooks */ public static Optional configurationHooksNullable() { - return Optional.ofNullable(configurationHooks.get()); + return Optional.ofNullable(configurationHooks != null + ? configurationHooks.get() + : null); } /** @@ -123,6 +125,8 @@ public static TelemetryHooks telemetryHooks() { * @return the telemetry hooks */ public static Optional telemetryHooksNullable() { - return Optional.ofNullable(telemetryHooks.get()); + return Optional.ofNullable(telemetryHooks != null + ? telemetryHooks.get() + : null); } }