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); } }