Skip to content

Commit

Permalink
Make SentryTransaction#finish thread-safe.
Browse files Browse the repository at this point in the history
Fixes #1253
  • Loading branch information
maciejwalkowiak committed Feb 16, 2021
1 parent 9003653 commit f4ee1ae
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sentry/src/main/java/io/sentry/SentryTransaction.java
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,9 @@ SentryId getTraceId() {
@Override
public void finish() {
this.timestamp = DateUtils.getCurrentDateTime();
if (this.throwable != null) {
hub.setSpanContext(this.throwable, this);
final Throwable throwable = this.throwable;
if (throwable != null) {
hub.setSpanContext(throwable, this);
}
this.getContexts().setTrace(this.context);
this.hub.captureTransaction(this, null);
Expand Down

0 comments on commit f4ee1ae

Please sign in to comment.