Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: NPE during error reporting#186

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fioan89 merged 2 commits intomainfromfix-npe-during-error-reporting
Sep 2, 2025

Conversation

fioan89
Copy link
Collaborator

The try/catch block raised NPE in thenotify if another exception was raised after the context containing the URL was reset - so that means an error in the onConnect handler. In addition, some of the reset steps were moved after onConnect to make sure they execute only if onConnect callback is successful.

Because of the fault in how the steps were arranged, the original exception was never logged instead a misleading NPE was treated by the coroutine's exception handler.

The try/catch block raised NPE in the `notify` if another exception was raisedafter the context containing the URL was reset - so that means an error in the onConnecthandler. In addition, some of the reset steps were moved after onConnect to make sure theyexecute only if onConnect callback is successful.Because of the fault in how the steps were arranged, the original exception was never loggedinstead a misleading NPE was treated by the coroutine's exception handler.
@fioan89
Copy link
CollaboratorAuthor

I'm putting this on draft because when I tried to test a scenario where onConnect raised an exception Toolbox refused to show the snackbar with the error requested by thenotify. I think it has something to do with calling lambdas passed as method references in the coroutines that are cancelled in the end. If I replace the "notify" with a simple showSnackbar call everything is fine. Of course, notify does a bit more than that so I need to either find a nother way to share/reuse that implementation in a different way, or understand why method references don't work too well in coroutines that become canceled.

@fioan89fioan89 marked this pull request as ready for reviewSeptember 1, 2025 20:11
@fioan89fioan89 merged commita68ab3a intomainSep 2, 2025
6 checks passed
@fioan89fioan89 deleted the fix-npe-during-error-reporting branchSeptember 2, 2025 16:49
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@matifalimatifalimatifali approved these changes

@f0sself0sself0ssel approved these changes

@code-ashercode-asherAwaiting requested review from code-asher

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@fioan89@matifali@f0ssel

[8]ページ先頭

©2009-2025 Movatter.jp