mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
fix crash when navigation graph is null (#706)
This commit is contained in:
parent
c9bffef7cb
commit
eb58cb1184
2 changed files with 10 additions and 9 deletions
|
@ -51,7 +51,7 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://developer.android.com/about/versions/14/behavior-changes-14#safer-dynamic-code-loading
|
// https://developer.android.com/about/versions/14/behavior-changes-14#safer-dynamic-code-loading
|
||||||
compileSdk = 33 // android 14 is fucked
|
compileSdk = 34 // android 14 is fucked
|
||||||
buildToolsVersion = "34.0.0"
|
buildToolsVersion = "34.0.0"
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
|
@ -157,7 +157,7 @@ dependencies {
|
||||||
implementation("androidx.test.ext:junit-ktx:1.1.5")
|
implementation("androidx.test.ext:junit-ktx:1.1.5")
|
||||||
testImplementation("org.json:json:20230618")
|
testImplementation("org.json:json:20230618")
|
||||||
|
|
||||||
implementation("androidx.core:core-ktx:1.10.1") // need 34 for higher
|
implementation("androidx.core:core-ktx:1.12.0") // need 34 for higher
|
||||||
implementation("androidx.appcompat:appcompat:1.6.1") // need target 32 for 1.5.0
|
implementation("androidx.appcompat:appcompat:1.6.1") // need target 32 for 1.5.0
|
||||||
|
|
||||||
// dont change this to 1.6.0 it looks ugly af
|
// dont change this to 1.6.0 it looks ugly af
|
||||||
|
@ -165,10 +165,10 @@ dependencies {
|
||||||
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
|
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
|
||||||
|
|
||||||
// need 34 for higher
|
// need 34 for higher
|
||||||
implementation("androidx.navigation:navigation-fragment-ktx:2.6.0")
|
implementation("androidx.navigation:navigation-fragment-ktx:2.7.4")
|
||||||
implementation("androidx.navigation:navigation-ui-ktx:2.6.0")
|
implementation("androidx.navigation:navigation-ui-ktx:2.7.4")
|
||||||
implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.6.1")
|
implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.6.2")
|
||||||
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1")
|
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2")
|
||||||
|
|
||||||
testImplementation("junit:junit:4.13.2")
|
testImplementation("junit:junit:4.13.2")
|
||||||
androidTestImplementation("androidx.test.ext:junit:1.1.5")
|
androidTestImplementation("androidx.test.ext:junit:1.1.5")
|
||||||
|
|
|
@ -178,9 +178,10 @@ object UIHelper {
|
||||||
fun Activity?.navigate(@IdRes navigation: Int, arguments: Bundle? = null) {
|
fun Activity?.navigate(@IdRes navigation: Int, arguments: Bundle? = null) {
|
||||||
try {
|
try {
|
||||||
if (this is FragmentActivity) {
|
if (this is FragmentActivity) {
|
||||||
(supportFragmentManager.findFragmentById(R.id.nav_host_fragment) as? NavHostFragment?)?.navController?.navigate(
|
val navHostFragment = supportFragmentManager.findFragmentById(R.id.nav_host_fragment) as? NavHostFragment?
|
||||||
navigation, arguments
|
navHostFragment?.navController?.let {
|
||||||
)
|
it.navigate(navigation, arguments)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (t: Throwable) {
|
} catch (t: Throwable) {
|
||||||
logError(t)
|
logError(t)
|
||||||
|
|
Loading…
Reference in a new issue