From 0455c6d0228d8db6b55a1a10858f9a67ff8dcf3b Mon Sep 17 00:00:00 2001 From: mihalin Date: Mon, 11 Apr 2022 17:24:13 +0300 Subject: [PATCH] fix empty locale --- server/custom.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/custom.py b/server/custom.py index b3f5997..0aaf397 100644 --- a/server/custom.py +++ b/server/custom.py @@ -24,6 +24,8 @@ _redis: ty.Optional[Redis] = None def _get_translator(message: types.Message) -> ty.Callable: + if not message.from_user.locale: + return _ return translators.get(message.from_user.locale.language, _)