Use more orEmpty extensions (#3399)
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/or-empty.html https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/or-empty.html
This commit is contained in:
parent
ed188783de
commit
ca29ee2b0b
13 changed files with 17 additions and 17 deletions
|
|
@ -114,7 +114,7 @@ class SearchActivity : BottomSheetActivity(), HasAndroidInjector, MenuProvider {
|
|||
|
||||
private fun handleIntent(intent: Intent) {
|
||||
if (Intent.ACTION_SEARCH == intent.action) {
|
||||
viewModel.currentQuery = intent.getStringExtra(SearchManager.QUERY) ?: ""
|
||||
viewModel.currentQuery = intent.getStringExtra(SearchManager.QUERY).orEmpty()
|
||||
viewModel.search(viewModel.currentQuery)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -468,7 +468,7 @@ class SearchStatusesFragment : SearchFragment<StatusViewData.Concrete>(), Status
|
|||
val intent = ComposeActivity.startIntent(
|
||||
requireContext(),
|
||||
ComposeOptions(
|
||||
content = redraftStatus.text ?: "",
|
||||
content = redraftStatus.text.orEmpty(),
|
||||
inReplyToId = redraftStatus.inReplyToId,
|
||||
visibility = redraftStatus.visibility,
|
||||
contentWarning = redraftStatus.spoilerText,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue