Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core, reporter): default exception handler may be null #1053

Merged
merged 1 commit into from
Apr 22, 2022

Conversation

mikehardy
Copy link
Contributor

@mikehardy mikehardy commented Apr 20, 2022

Underlying Java API documents it as potentially null
https://developer.android.com/reference/java/lang/Thread#getDefaultUncaughtExceptionHandler()

Null values are handled in ReportExecutor (the only consumer of this value that I know of?):

private val defaultExceptionHandler: Thread.UncaughtExceptionHandler?, private val processFinisher: ProcessFinisher,

Fixes a crash in robolectric contexts where it actually is null

Test Plan: I made the correct package directory structure, copied the original version of the file in to AnkiDroid's codebase that way and ran it - reproduce the failure in our robolectric tests - ran this changed version and it worked

Also ./gradlew test passed locally

@mikehardy
Copy link
Contributor Author

Yes!! Thanks @F43nd1r - this is the last thing stopping us from finally moving off our 5.7 versions with annotation config, through 5.8 up to 5.9....2 I guess :-), with it's new config style and everything. Much appreciated!

@mikehardy mikehardy deleted the nullable-default-handler branch April 22, 2022 20:17
@F43nd1r
Copy link
Member

F43nd1r commented Apr 22, 2022

5.9.3 in the end, because 5.9.2 failed to publish due to Kotlin/dokka#2452

@mikehardy
Copy link
Contributor Author

It's always something...

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