File tree Expand file tree Collapse file tree
dd-java-agent/appsec/src/main/java/com/datadog/appsec Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -129,9 +129,12 @@ public static void stop() {
129129 return ;
130130 }
131131 REPLACEABLE_EVENT_PRODUCER = null ;
132- STOP_SUBSCRIPTION_SERVICE .run ();
133- STOP_SUBSCRIPTION_SERVICE = null ;
134- RESET_SUBSCRIPTION_SERVICE = null ;
132+ final Runnable stop = STOP_SUBSCRIPTION_SERVICE ;
133+ if (stop != null ) {
134+ stop .run ();
135+ STOP_SUBSCRIPTION_SERVICE = null ;
136+ RESET_SUBSCRIPTION_SERVICE = null ;
137+ }
135138 Blocking .setBlockingService (BlockingService .NOOP );
136139
137140 APP_SEC_CONFIG_SERVICE .close ();
@@ -180,8 +183,9 @@ private static void reloadSubscriptions(
180183
181184 replaceableEventProducerService .replaceEventProducerService (newEd );
182185
183- if (RESET_SUBSCRIPTION_SERVICE != null ) {
184- RESET_SUBSCRIPTION_SERVICE .run ();
186+ final Runnable reset = RESET_SUBSCRIPTION_SERVICE ;
187+ if (reset != null ) {
188+ reset .run ();
185189 }
186190 }
187191
You can’t perform that action at this time.
0 commit comments