Philipp Hörist pushed to branch master at gajim / gajim


Commits:
3e9aa791 by Philipp Hörist at 2026-01-28T23:36:08+01:00
fix: ConversationView: Degrade gracefully on unexpected state when retriving 
avatar

- - - - -


1 changed file:

- gajim/gtk/util/misc.py


Changes:

=====================================
gajim/gtk/util/misc.py
=====================================
@@ -191,8 +191,10 @@ def get_avatar_for_message(
             )
 
         case MessageType.CHAT:
-            assert isinstance(contact, BareContact)
-            return contact.get_avatar(size, scale, add_show=False)
+            if isinstance(contact, BareContact):
+                return contact.get_avatar(size, scale, add_show=False)
+            log.warning("Unexpected contact type %r, unable to get avatar", 
contact)
+            return None
 
         case _:
             raise ValueError(f"Unhandled type: {db_row.type}")



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/3e9aa791dab14516eab4ad3147cc86913ff4fb36

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/3e9aa791dab14516eab4ad3147cc86913ff4fb36
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to