fix: searchHistoryAdapter call before initialized
This commit is contained in:
parent
988e4def64
commit
13e2e37225
1 changed files with 4 additions and 1 deletions
|
@ -319,7 +319,10 @@ class SearchAdapter(private val activity: SearchActivity, private val type: Stri
|
|||
|
||||
|
||||
fun addHistory() {
|
||||
searchHistoryAdapter.add(binding.searchBarText.text.toString())
|
||||
if (::searchHistoryAdapter.isInitialized &&
|
||||
binding.searchBarText.text.toString().isNotBlank()
|
||||
)
|
||||
searchHistoryAdapter.add(binding.searchBarText.text.toString())
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int = 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue