mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-30 05:31:34 +01:00
Fix illegal argument navigation exceptions.
This commit is contained in:
committed by
Greyson Parrelli
parent
ba54051f8c
commit
a4f44a96fd
@@ -21,6 +21,7 @@ import org.thoughtcrime.securesms.mediasend.Media
|
||||
import org.thoughtcrime.securesms.mediasend.MediaSendActivityResult
|
||||
import org.thoughtcrime.securesms.mediasend.v2.review.MediaReviewFragment
|
||||
import org.thoughtcrime.securesms.recipients.RecipientId
|
||||
import org.thoughtcrime.securesms.util.navigation.safeNavigate
|
||||
|
||||
class MediaSelectionActivity :
|
||||
PassphraseRequiredActivity(),
|
||||
@@ -122,7 +123,7 @@ class MediaSelectionActivity :
|
||||
|
||||
val startDestination: Int = intent.getIntExtra(START_ACTION, -1)
|
||||
return if (startDestination > 0) {
|
||||
hostFragment.navController.navigate(
|
||||
hostFragment.navController.safeNavigate(
|
||||
startDestination,
|
||||
Bundle().apply {
|
||||
putBoolean("first", true)
|
||||
|
||||
@@ -7,6 +7,7 @@ import androidx.fragment.app.Fragment
|
||||
import androidx.navigation.Navigation
|
||||
import org.thoughtcrime.securesms.R
|
||||
import org.thoughtcrime.securesms.permissions.Permissions
|
||||
import org.thoughtcrime.securesms.util.navigation.safeNavigate
|
||||
|
||||
class MediaSelectionNavigator(
|
||||
private val toCamera: Int = -1,
|
||||
@@ -19,13 +20,13 @@ class MediaSelectionNavigator(
|
||||
fun goToCamera(view: View) {
|
||||
if (toCamera == -1) return
|
||||
|
||||
Navigation.findNavController(view).navigate(toCamera)
|
||||
Navigation.findNavController(view).safeNavigate(toCamera)
|
||||
}
|
||||
|
||||
fun goToGallery(view: View) {
|
||||
if (toGallery == -1) return
|
||||
|
||||
Navigation.findNavController(view).navigate(toGallery)
|
||||
Navigation.findNavController(view).safeNavigate(toGallery)
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
Reference in New Issue
Block a user