Improve SourcePreferences error
This commit is contained in:
parent
3dd86c3f77
commit
c8446b8d65
@ -141,17 +141,20 @@ class SourcePreferencesFragment : PreferenceFragmentCompat() {
|
|||||||
private fun populateScreen(): PreferenceScreen {
|
private fun populateScreen(): PreferenceScreen {
|
||||||
val sourceId = requireArguments().getLong(SOURCE_ID)
|
val sourceId = requireArguments().getLong(SOURCE_ID)
|
||||||
// SY -->
|
// SY -->
|
||||||
val source = Injekt.get<SourceManager>().get(sourceId)!!.let { source ->
|
val source = Injekt.get<SourceManager>()
|
||||||
if (source is EnhancedHttpSource) {
|
.get(sourceId)
|
||||||
if (source.enhancedSource is ConfigurableSource) {
|
?.let { source ->
|
||||||
source.source()
|
if (source is EnhancedHttpSource) {
|
||||||
|
if (source.enhancedSource is ConfigurableSource) {
|
||||||
|
source.source()
|
||||||
|
} else {
|
||||||
|
source.originalSource
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
source.originalSource
|
source
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
source
|
|
||||||
}
|
}
|
||||||
}
|
?: throw NullPointerException("source = null, SOURCE_ID = $SOURCE_ID")
|
||||||
// SY <--
|
// SY <--
|
||||||
|
|
||||||
check(source is ConfigurableSource)
|
check(source is ConfigurableSource)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user