Skip to content

Commit

Permalink
fix: searchHistoryAdapter call before initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
rebelonion committed May 11, 2024
1 parent 988e4de commit 13e2e37
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/src/main/java/ani/dantotsu/media/SearchAdapter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 13e2e37

Please sign in to comment.