File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
RNSentryAndroidTester/app/src/test/java/io/sentry/react
android/src/main/java/io/sentry/react Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,15 @@ class RNSentryStartTest {
5858 assertEquals(" http://localhost:8969/teststream" , actualOptions.spotlightConnectionUrl)
5959 }
6060
61+ @Test
62+ fun `when the spotlight option is enabled without defaultSidecarUrl, the spotlight is enabled and does not crash` () {
63+ val options = JavaOnlyMap .of(" spotlight" , true )
64+ val actualOptions = SentryAndroidOptions ()
65+ RNSentryStart .getSentryAndroidOptions(actualOptions, options, logger)
66+ assert (actualOptions.isEnableSpotlight)
67+ assertNull(actualOptions.spotlightConnectionUrl)
68+ }
69+
6170 @Test
6271 fun `when the spotlight option is disabled, the spotlight SentryAndroidOption is set to false` () {
6372 val options = JavaOnlyMap .of(" spotlight" , false )
Original file line number Diff line number Diff line change @@ -148,7 +148,9 @@ static void getSentryAndroidOptions(
148148 if (rnOptions .hasKey ("spotlight" )) {
149149 if (rnOptions .getType ("spotlight" ) == ReadableType .Boolean ) {
150150 options .setEnableSpotlight (rnOptions .getBoolean ("spotlight" ));
151- options .setSpotlightConnectionUrl (rnOptions .getString ("defaultSidecarUrl" ));
151+ if (rnOptions .hasKey ("defaultSidecarUrl" )) {
152+ options .setSpotlightConnectionUrl (rnOptions .getString ("defaultSidecarUrl" ));
153+ }
152154 } else if (rnOptions .getType ("spotlight" ) == ReadableType .String ) {
153155 options .setEnableSpotlight (true );
154156 options .setSpotlightConnectionUrl (rnOptions .getString ("spotlight" ));
You can’t perform that action at this time.
0 commit comments