mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
fix: #544 return locale None if User is absent
This commit is contained in:
parent
15a6e94135
commit
1ee6284011
1 changed files with 1 additions and 1 deletions
|
|
@ -129,7 +129,7 @@ class I18nMiddleware(BaseMiddleware):
|
|||
:return: locale name
|
||||
"""
|
||||
user: types.User = types.User.get_current()
|
||||
locale: Locale = user.locale
|
||||
locale: Locale = user.locale if user else None
|
||||
|
||||
if locale:
|
||||
*_, data = args
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue