Skip to content

Commit

Permalink
compat with BriefUserModel
Browse files Browse the repository at this point in the history
  • Loading branch information
cosven committed Jan 6, 2024
1 parent b804a7f commit 2302bb7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions feeluown/gui/components/avatar.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from PyQt5.QtWidgets import QMenu, QAction
from PyQt5.QtGui import QPainter, QIcon, QPalette, QContextMenuEvent

from feeluown.library import NoUserLoggedIn
from feeluown.library import NoUserLoggedIn, UserModel
from feeluown.models.uri import reverse
from feeluown.utils.aio import run_afn, run_fn
from feeluown.gui.provider_ui import UISupportsLoginOrGoHome, ProviderUiItem, \
Expand Down Expand Up @@ -116,7 +116,7 @@ async def _show_provider_current_user(self, name):

if user is None:
return None
if user.avatar_url:
if isinstance(user, UserModel) and user.avatar_url:
img_data = await run_afn(self._app.img_mgr.get, user.avatar_url,
reverse(user))
if img_data:
Expand Down

0 comments on commit 2302bb7

Please sign in to comment.