File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
android/src/main/java/io/sentry/react Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -14,19 +14,23 @@ public class RNSentryBreadcrumb {
14
14
15
15
@ Nullable
16
16
public static String getCurrentScreenFrom (ReadableMap from ) {
17
- final @ Nullable String maybeCategory = from .hasKey ("category" ) ? from .getString ("category" ) : null ;
18
- if (maybeCategory == null || !maybeCategory .equals ("navigation" )) {
17
+ if (!from .hasKey ("category" )) {
19
18
return null ;
20
19
}
20
+ final @ Nullable String category = from .getString ("category" ) :
21
21
22
- final @ Nullable ReadableMap maybeData = from .hasKey ("data" ) ? from .getMap ("data" ) : null ;
23
- if (maybeData == null ) {
22
+ if (!category .equals ("navigation" )) {
24
23
return null ;
25
24
}
26
25
26
+ if (!from .hasKey ("data" )) {
27
+ return null ;
28
+ }
29
+ final @ Nullable ReadableMap data = from .getMap ("data" );
30
+
27
31
try {
28
32
// getString might throw if cast to string fails (data.to is not enforced by TS to be a string)
29
- return maybeData .hasKey ("to" ) ? maybeData .getString ("to" ) : null ;
33
+ return data .hasKey ("to" ) ? data .getString ("to" ) : null ;
30
34
} catch (Throwable exception ) {
31
35
return null ;
32
36
}
You can’t perform that action at this time.
0 commit comments