Repository navigation
Skip closing the Android and Cocoa SDKs without options - #2931
Merged
Merged
Conversation
bitsandfoxes
force-pushed
the
fix/native-close-null-options
branch
2 times, most recently
from
November 9, 2026 16:19
330303d to
81e960d
Compare
bitsandfoxes
force-pushed
the
fix/native-close-null-options
branch
from
November 10, 2026 15:44
81e960d to
b211d03
Compare
bitsandfoxes
marked this pull request as ready for review
November 11, 2026 09:46
bitsandfoxes
requested review from
a team,
jpnurmi,
limbonaut and
tustanivsky
November 11, 2026 09:46
jpnurmi
approved these changes
Nov 11, 2026
This was referenced Nov 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Android and iOS, the SDK no longer throws a
NullReferenceExceptionduring startup when it can't load its options.SentryInitializationcloses the native SDK whenever the C# SDK doesn't initialize, and it passes along the options it loaded. When the options asset can't be loaded, for example when the configuration lives in an OBB file that isn't available yet, those options arenull.SentryNativeAndroid.CloseandSentryNativeCocoa.Closeread native support settings from them and threw.Both now return early on
nulloptions, asSentryNativeMacos.Closealready did. The native SDK stays as it is, since there are no options saying whether it should be closed. All threeClosemethods now takeSentryUnityOptions?.Each
Closegets an internal overload that takes the platform, asSentryNativeCocoa.Configuredoes. In the Editor, the platform check returns early without reading the options, so the tests pass Android or iPhone explicitly to reach the code that read them.Tests:
Close_OptionsNull_DoesNotCloseSentryJava(Android) andClose_OptionsNull_DoesNotThrow(Cocoa).🤖 Generated with Claude Code