Skip to content

Commit

Permalink
Confirm the filtered result array is not a null
Browse files Browse the repository at this point in the history
  • Loading branch information
AbandonedCart committed Dec 1, 2023
1 parent 5a10e99 commit 806eb56
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ class BrowserAdapter(
@SuppressLint("NotifyDataSetChanged")
override fun publishResults(charSequence: CharSequence?, filterResults: FilterResults) {
if (filteredData === filterResults.values) return
filterResults.values.let { filteredData = it as ArrayList<AmiiboFile?> }
filterResults.values?.let { filteredData = it as ArrayList<AmiiboFile?> }
if (itemCount > 0) Collections.sort(filteredData, AmiiboFileComparator(settings))
notifyDataSetChanged()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class FoomiiboAdapter(
@SuppressLint("NotifyDataSetChanged")
override fun publishResults(charSequence: CharSequence?, filterResults: FilterResults) {
if (filteredData === filterResults.values) return
filterResults.values.let { filteredData = it as ArrayList<Amiibo> }
filterResults.values?.let { filteredData = it as ArrayList<Amiibo> }
if (itemCount > 0) {
Collections.sort(filteredData, AmiiboComparator(settings))
val missingFiles: ArrayList<Amiibo> = arrayListOf()
Expand Down

0 comments on commit 806eb56

Please sign in to comment.