File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
sentry-kotlin-multiplatform
src/appleMain/kotlin/io/sentry/kotlin/multiplatform Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -54,4 +54,4 @@ Pod::Spec.new do |spec|
5454 }
5555 ]
5656
57- end
57+ end
Original file line number Diff line number Diff line change @@ -20,8 +20,12 @@ public actual abstract class Context
2020// like on JVM and Android, we may do that later on if needed.
2121internal actual fun SentryPlatformOptions.prepareForInit () {
2222 val cocoa = this as ? CocoaSentryOptions
23- val existingBeforeSend = cocoa?.beforeSend
23+ val userDefinedBeforeSend = cocoa?.beforeSend
2424 val modifiedBeforeSend: (CocoaSentryEvent ? ) -> CocoaSentryEvent ? = beforeSend@{ event ->
25+ // Return early if the user's beforeSend returns null
26+ if (userDefinedBeforeSend != null && userDefinedBeforeSend.invoke(event) == null ) {
27+ return @beforeSend null
28+ }
2529 val cocoaName = BuildKonfig .SENTRY_COCOA_PACKAGE_NAME
2630 val cocoaVersion = BuildKonfig .SENTRY_COCOA_VERSION
2731
@@ -32,9 +36,6 @@ internal actual fun SentryPlatformOptions.prepareForInit() {
3236 sdk[" packages" ] = packages
3337 event?.sdk = sdk
3438
35- if (existingBeforeSend?.invoke(event) == null ) {
36- return @beforeSend null
37- }
3839 dropKotlinCrashEvent(event)
3940 }
4041
You can’t perform that action at this time.
0 commit comments