diff --git a/customattrs/src/main/java/de/mm20/launcher2/customattrs/CustomAttributesRepository.kt b/customattrs/src/main/java/de/mm20/launcher2/customattrs/CustomAttributesRepository.kt index 7ee039f3..ed823883 100644 --- a/customattrs/src/main/java/de/mm20/launcher2/customattrs/CustomAttributesRepository.kt +++ b/customattrs/src/main/java/de/mm20/launcher2/customattrs/CustomAttributesRepository.kt @@ -9,6 +9,7 @@ import de.mm20.launcher2.ktx.jsonObjectOf import de.mm20.launcher2.search.data.Searchable import kotlinx.coroutines.* import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.flow import kotlinx.coroutines.flow.map import org.json.JSONArray import org.json.JSONException @@ -84,6 +85,11 @@ internal class CustomAttributesRepositoryImpl( } override suspend fun search(query: String): Flow> { + if (query.isBlank()) { + return flow { + emit(emptyList()) + } + } val dao = appDatabase.customAttrsDao() return dao.search("%$query%").map { favoritesRepository.getFromKeys(it)