Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ Task<Void> stopTrace(int id, Bundle metrics, Bundle attributes) {
return Tasks.call(
() -> {
Trace trace = traces.get(id);
// Traces can be cleared during module teardown before JS stops them.
if (trace == null) {
return null;
}

Set<String> metricKeys = metrics.keySet();
Set<String> attributeKeys = attributes.keySet();
Expand Down Expand Up @@ -119,6 +123,10 @@ Task<Void> stopScreenTrace(int id) {
return Tasks.call(
() -> {
ScreenTrace trace = screenTraces.get(id);
// Screen traces can be cleared during module teardown before JS stops them.
if (trace == null) {
return null;
}
trace.sendScreenTrace();
screenTraces.remove(id);

Expand All @@ -140,6 +148,10 @@ Task<Void> stopHttpMetric(int id, Bundle httpMetricConfig, Bundle attributes) {
return Tasks.call(
() -> {
HttpMetric httpMetric = httpMetrics.get(id);
// HTTP metrics can be cleared during module teardown before JS stops them.
if (httpMetric == null) {
return null;
}

if (httpMetricConfig.containsKey("httpResponseCode")) {
httpMetric.setHttpResponseCode((int) httpMetricConfig.getDouble("httpResponseCode"));
Expand Down
Loading