Repository navigation
Skip closing the Android and Cocoa SDKs without options - #2931
Draft
bitsandfoxes wants to merge 4 commits into
Draft
bitsandfoxes wants to merge 4 commits into
bitsandfoxes wants to merge 4 commits into
Conversation
bitsandfoxes
force-pushed
the
fix/native-close-null-options
branch
from
November 4, 2026 15:47
b72d090 to
330303d
Compare
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