Updated on 2026-08-14

This commit is contained in:
Tangem 2019-10-16 10:41:29 +03:00
parent 64ded4f72e
commit 903ebe797f
3 changed files with 20 additions and 10 deletions

View file

@ -0,0 +1,16 @@
package com.tangem.util
import android.os.Bundle
import android.util.Log
import androidx.annotation.IdRes
import androidx.navigation.NavController
fun NavController.navigateSafely(@IdRes destination: Int, data: Bundle? = null) {
try {
this.navigate(destination, data)
} catch (e: IllegalArgumentException) {
Log.w(this::class.java.simpleName, e.message)
} catch (e: IllegalStateException) {
Log.w(this::class.java.simpleName, e.message)
}
}