Skip to content

Commit

Permalink
Remove unnecessary hacks
Browse files Browse the repository at this point in the history
  • Loading branch information
aritchie committed Feb 21, 2025
1 parent 18a1079 commit 000b324
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Sentry.Bindings.Cocoa/ApiDefinitions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace Sentry.CocoaSdk;

// typedef SentryEvent * _Nullable (^SentryBeforeSendEventCallback)(SentryEvent * _Nonnull);
[Internal]
delegate SentryEvent? SentryBeforeSendEventCallback (SentryEvent @event);
delegate SentryEvent SentryBeforeSendEventCallback (SentryEvent @event);

// typedef id<SentrySpan> _Nullable (^SentryBeforeSendSpanCallback)(id<SentrySpan> _Nonnull);
[Internal]
Expand Down
4 changes: 1 addition & 3 deletions src/Sentry/Platforms/Cocoa/SentrySdk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,9 @@ private static void InitSentryCocoaSdk(SentryOptions options)
return evt;

var result = options.BeforeSendInternal(sentryEvent, null!);
#pragma warning disable 8603
// returning null is fine - the native binding even has this set, but the tooling doesn't want to obey, so the pragma was necessary
if (result == null)
return null;
#pragma warning restore 8603
return null!;

evt.ServerName = result.ServerName;
evt.Dist = result.Distribution;
Expand Down

0 comments on commit 000b324

Please sign in to comment.