Skip to content

Conversation

philprime
Copy link
Member

📜 Description

Corrected the application of the SENTRY_UNWRAP_NULLABLE macro in SentryProfiler.mm to directly unwrap configurationFromLaunch.profileOptions.

💡 Motivation and Context

The SENTRY_UNWRAP_NULLABLE macro was incorrectly attempting to unwrap configurationFromLaunch (type SentryProfileConfiguration *) as SentryProfileOptions, then accessing .profileOptions on the result. This type mismatch could lead to compilation errors or runtime crashes. The change ensures the macro unwraps configurationFromLaunch.profileOptions (type SentryProfileOptions *) directly, resolving the issue.

💚 How did you test it?

Verified that no other instances of the incorrect SENTRY_UNWRAP_NULLABLE(SentryProfileOptions, configurationFromLaunch) remained and that other related usages were already correct.

📝 Checklist

You have to check all boxes before merging:

  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

Open in Cursor Open in Web

Co-authored-by: phil.niedertscheider <phil.niedertscheider@sentry.io>
Copy link

cursor bot commented Aug 12, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

Copy link
Contributor

Fails
🚫 Please consider adding a changelog entry for the next release.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

- Fix sentry unwrap nullable macro type mismatch ([#5890](https://github.com/getsentry/sentry-cocoa/pull/5890))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description or adding a skip-changelog label.

Generated by 🚫 dangerJS against 78c257b

@philprime philprime marked this pull request as ready for review August 12, 2025 11:05
@philprime philprime merged commit 982d875 into philprime/strict-nullability-2 Aug 12, 2025
99 of 104 checks passed
@philprime philprime deleted the cursor/fix-sentry-unwrap-nullable-macro-type-mismatch-fa89 branch August 12, 2025 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants