Skip to content

Commit 4cb4c02

Browse files
committed
Update
1 parent 37405f6 commit 4cb4c02

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

sentry-kotlin-multiplatform/src/appleMain/kotlin/io/sentry/kotlin/multiplatform/SentryBridge.apple.kt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@ internal actual fun SentryPlatformOptions.prepareForInit() {
2222
val cocoa = this as? CocoaSentryOptions
2323
val existingBeforeSend = cocoa?.beforeSend
2424
val modifiedBeforeSend: (CocoaSentryEvent?) -> CocoaSentryEvent? = beforeSend@{ event ->
25-
// Return early if the user's beforeSend returns null
26-
if (existingBeforeSend != null && existingBeforeSend.invoke(event) == null) {
27-
return@beforeSend null
28-
}
29-
3025
val cocoaName = BuildKonfig.SENTRY_COCOA_PACKAGE_NAME
3126
val cocoaVersion = BuildKonfig.SENTRY_COCOA_VERSION
3227

@@ -37,7 +32,9 @@ internal actual fun SentryPlatformOptions.prepareForInit() {
3732
sdk["packages"] = packages
3833
event?.sdk = sdk
3934

40-
existingBeforeSend?.invoke(event)
35+
if (existingBeforeSend?.invoke(event) == null) {
36+
return@beforeSend null
37+
}
4138
dropKotlinCrashEvent(event)
4239
}
4340

0 commit comments

Comments
 (0)