Commit 2a02d693 authored by Roger Yang's avatar Roger Yang
Browse files

Closes #8264: Pass copy of breadcrumbs to crash reporting services

parent f05825fa
......@@ -96,6 +96,14 @@ class CrashReporter(
return this
}
/**
* Get a copy of the crashBreadCrumbs
*/
internal fun crashBreadcrumbsCopy(): ArrayList<Breadcrumb> {
@Suppress("UNCHECKED_CAST")
return crashBreadcrumbs.clone() as ArrayList<Breadcrumb>
}
/**
* Submit a crash report to all registered services.
*/
......@@ -158,7 +166,7 @@ class CrashReporter(
logger.info("Caught Exception report submitted to ${services.size} services")
return scope.launch {
services.forEach {
it.report(reportThrowable, crashBreadcrumbs)
it.report(reportThrowable, crashBreadcrumbsCopy())
}
}
}
......
......@@ -37,7 +37,7 @@ class ExceptionHandler(
context,
Crash.UncaughtExceptionCrash(
throwable = throwable,
breadcrumbs = crashReporter.crashBreadcrumbs
breadcrumbs = crashReporter.crashBreadcrumbsCopy()
)
)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment