mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
fix: #544 User is Optional
This commit is contained in:
parent
a67c1b0ce4
commit
9d779b77eb
1 changed files with 1 additions and 1 deletions
|
|
@ -128,7 +128,7 @@ class I18nMiddleware(BaseMiddleware):
|
|||
:param args: event arguments
|
||||
:return: locale name
|
||||
"""
|
||||
user: types.User = types.User.get_current()
|
||||
user: Optional[types.User] = types.User.get_current()
|
||||
locale: Optional[Locale] = user.locale if user else None
|
||||
|
||||
if locale:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue