Fix illegal argument navigation exceptions.

This commit is contained in:
Cody Henthorne
2021-12-15 16:07:54 -05:00
committed by Greyson Parrelli
parent ba54051f8c
commit a4f44a96fd
70 changed files with 337 additions and 207 deletions

View File

@@ -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)

View File

@@ -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 {