fix: prevents NPE on null key material on android #288
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.
NPE was showing up in the following tests when clicking run unit tests on
main
branchNPE was traced to key material sometimes being null during conversation create on Android.
If you re-click "run" for the test, it would usually pass on second run through.
Though it is strange that re-running the test make key material not null, we want to deal with the null key material gracefully since it is of type ByteArray? in xmtp-android => https://github.com/xmtp/xmtp-android/blob/5da219acc9c14c46fc35020e7a445725b28f5ce5/library/src/main/java/org/xmtp/android/library/Conversation.kt#L82
This PR also adds logging so we can note when keyMaterial is null on Android, so we can troubleshoot why it is null going forward.