Skip to content

Commit

Permalink
fix merge
Browse files Browse the repository at this point in the history
  • Loading branch information
jandro996 committed Jun 17, 2024
1 parent d71fbfd commit 4b5ff15
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.datadog.appsec.stack_trace.StackTraceCollection;
import com.datadog.appsec.stack_trace.StackTraceEvent;
import com.datadog.appsec.util.StandardizedLogging;
import datadog.trace.api.Config;
import datadog.trace.api.http.StoredBodySupplier;
import datadog.trace.api.internal.TraceSegment;
import io.sqreen.powerwaf.Additive;
Expand Down Expand Up @@ -413,14 +414,11 @@ public void reportEvents(Collection<AppSecEvent> appSecEvents) {
for (AppSecEvent event : appSecEvents) {
StandardizedLogging.attackDetected(log, event);
}
synchronized (this) {
if (this.collectedEvents == null) {
this.collectedEvents = new ArrayList<>();
}
try {
this.collectedEvents.addAll(events);
} catch (UnsupportedOperationException e) {
throw new IllegalStateException("Events cannot be added anymore");
if (this.appSecEvents == null) {
synchronized (this) {
if (this.appSecEvents == null) {
this.appSecEvents = new ConcurrentLinkedQueue<>();
}
}
}
this.appSecEvents.addAll(appSecEvents);
Expand Down

0 comments on commit 4b5ff15

Please sign in to comment.