search: return null on whitespace search term
Build and test / build (push) Successful in 7m19s

This commit is contained in:
2026-06-08 12:42:08 +09:00
parent 832a74f9c2
commit 5acebc19cd
3 changed files with 19 additions and 3 deletions
+2 -2
View File
@@ -246,12 +246,12 @@ Future<List<ScoredEntryId>> fetchEntryIds(
int? pageSize,
int? offset,
) async {
assert(word.trim().isNotEmpty, 'Word should not be empty when fetching entry IDs');
if (searchMode == SearchMode.auto) {
searchMode = _determineSearchMode(word);
}
assert(word.isNotEmpty, 'Word should not be empty when fetching entry IDs');
late final List<ScoredEntryId> entryIds;
switch (searchMode) {
case SearchMode.kanji:
+1 -1
View File
@@ -41,7 +41,7 @@ Future<List<WordSearchResult>?> searchWordWithDbConnection(
int page = 0,
int? pageSize,
}) async {
if (word.isEmpty) {
if (word.trim().isEmpty) {
return null;
}