File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed
sentry-reactor/src/main/java/io/sentry/reactor Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,11 @@ public Object key() {
1616
1717 @ Override
1818 public IScopes getValue () {
19- return Sentry .getCurrentScopes ();
19+ if (Sentry .hasScopes ()) {
20+ return Sentry .getCurrentScopes ();
21+ } else {
22+ return NoOpScopes .getInstance ();
23+ }
2024 }
2125
2226 @ Override
Original file line number Diff line number Diff line change @@ -2599,6 +2599,7 @@ public final class io/sentry/Sentry {
25992599 public static fun getLastEventId ()Lio/sentry/protocol/SentryId;
26002600 public static fun getSpan ()Lio/sentry/ISpan;
26012601 public static fun getTraceparent ()Lio/sentry/SentryTraceHeader;
2602+ public static fun hasScopes ()Z
26022603 public static fun init ()V
26032604 public static fun init (Lio/sentry/OptionsContainer;Lio/sentry/Sentry$OptionsConfiguration;)V
26042605 public static fun init (Lio/sentry/OptionsContainer;Lio/sentry/Sentry$OptionsConfiguration;Z)V
Original file line number Diff line number Diff line change @@ -112,6 +112,12 @@ private Sentry() {}
112112 return scopes ;
113113 }
114114
115+ @ ApiStatus .Internal
116+ public static boolean hasScopes () {
117+ final @ Nullable IScopes scopes = getScopesStorage ().get ();
118+ return scopes != null && !scopes .isNoOp ();
119+ }
120+
115121 private static @ NotNull IScopesStorage getScopesStorage () {
116122 return scopesStorage ;
117123 }
You can’t perform that action at this time.
0 commit comments