None check added

This commit is contained in:
Profitroll 2023-08-30 14:04:36 +02:00
parent 0006703daf
commit a9a92257dc
Signed by: profitroll
GPG Key ID: FA35CAB49DACD3B2
2 changed files with 2 additions and 2 deletions

View File

@ -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() 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( await message.reply_text(
app._("location_name_empty", "messages", locale=user.locale).format( app._("location_name_empty", "messages", locale=user.locale).format(
cancel_notice=app._("cancel", "messages", locale=user.locale) cancel_notice=app._("cancel", "messages", locale=user.locale)

View File

@ -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() 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( await message.reply_text(
app._("search_nearby_empty", "messages", locale=user.locale) app._("search_nearby_empty", "messages", locale=user.locale)
) )