diff --git a/modules/search_name.py b/modules/search_name.py index 3377021..9f0ad2e 100644 --- a/modules/search_name.py +++ b/modules/search_name.py @@ -48,7 +48,7 @@ async def search_name(app: PyroClient, message: Message) -> Union[Location, None locations = await col_locations.find(query).limit(6).to_list() - if len(locations) == 0: + if len(locations) == 0 or locations is None: await message.reply_text( app._("location_name_empty", "messages", locale=user.locale).format( cancel_notice=app._("cancel", "messages", locale=user.locale) diff --git a/modules/search_nearby.py b/modules/search_nearby.py index 30af99b..7b95d00 100644 --- a/modules/search_nearby.py +++ b/modules/search_nearby.py @@ -26,7 +26,7 @@ async def search_nearby(app: PyroClient, message: Message) -> Union[Location, No locations = await col_locations.find(query).limit(6).to_list() - if len(locations) == 0: + if len(locations) == 0 or locations is None: await message.reply_text( app._("search_nearby_empty", "messages", locale=user.locale) )