Skip to content

Commit 27a1696

Browse files
antonisclaude
andcommitted
fix(ios): Guard replay postInit behind runtime session replay check
When iOS deployment target >= 16.0, SENTRY_TARGET_REPLAY_SUPPORTED is true at compile time, but postInit was called unconditionally even when session replay was not configured. This caused a SIGABRT crash on launch in release builds with New Architecture (TurboModules) because the breadcrumb converter installed by postInit referenced a nil replay instance. Fixes #5679 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e119987 commit 27a1696

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/core/ios/RNSentryStart.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ + (void)startWithOptions:(SentryOptions *)options NS_SWIFT_NAME(start(options:))
2929
[SentrySDK startWithOptions:options];
3030

3131
#if SENTRY_TARGET_REPLAY_SUPPORTED
32-
[RNSentryReplay postInit];
32+
if (options.sessionReplay.sessionSampleRate > 0 || options.sessionReplay.onErrorSampleRate > 0) {
33+
[RNSentryReplay postInit];
34+
}
3335
#endif
3436

3537
[self postDidBecomeActiveNotification];

0 commit comments

Comments
 (0)