mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-21 20:47:03 -05:00
Avoid NPE in browse source screen
It logically should never be null, yet I see crash logs about it.
This commit is contained in:
parent
6e04822f5e
commit
78b76a186c
1 changed files with 3 additions and 3 deletions
|
@ -226,9 +226,9 @@ fun BrowseSourceContent(
|
||||||
val getErrorMessage: (LoadState.Error) -> String = { state ->
|
val getErrorMessage: (LoadState.Error) -> String = { state ->
|
||||||
when {
|
when {
|
||||||
state.error is NoResultsException -> context.getString(R.string.no_results_found)
|
state.error is NoResultsException -> context.getString(R.string.no_results_found)
|
||||||
state.error.message == null -> ""
|
state.error.message.isNullOrEmpty() -> ""
|
||||||
state.error.message!!.startsWith("HTTP error") -> "${state.error.message}: ${context.getString(R.string.http_error_hint)}"
|
state.error.message.orEmpty().startsWith("HTTP error") -> "${state.error.message}: ${context.getString(R.string.http_error_hint)}"
|
||||||
else -> state.error.message!!
|
else -> state.error.message.orEmpty()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue