-
Notifications
You must be signed in to change notification settings - Fork 386
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 crash in request vpn permission #6547
Fix crash in request vpn permission #6547
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @Pururun)
android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/util/RequestVpnPermission.kt
line 11 at r1 (raw file):
class RequestVpnPermission : ActivityResultContract<Unit, Boolean>() { override fun createIntent(context: Context, input: Unit): Intent { return VpnService.prepare(context)
This is a bit unclear, return type is Intent
but VpnService.prepare(context)
can return null right? We should at least do !!
to make it clear that we don't expect a null.
bbf2c87
to
e3de3f4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @Rawa)
android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/util/RequestVpnPermission.kt
line 11 at r1 (raw file):
Previously, Rawa (David Göransson) wrote…
This is a bit unclear, return type is
Intent
butVpnService.prepare(context)
can return null right? We should at least do!!
to make it clear that we don't expect a null.
Done.
e3de3f4
to
595e519
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved
This crash could occur if create intent in request vpn permission was called while vpn permission was already approved Fixed by returning true immediately in those cases
595e519
to
84fbae1
Compare
This crash could occur if create intent in request vpn permission was called while vpn permission was already approved
Fixed by returning true immediately in those cases
This change is