Skip to content
Snippets Groups Projects
Commit c25510a8 authored by Philipp Hörist's avatar Philipp Hörist
Browse files

fix: ChatControl: Don’t assume messages always have a resource

Fixes: #11042
parent 54c10fd2
No related branches found
No related tags found
No related merge requests found
......@@ -376,8 +376,12 @@ def _on_message_received(self, event: events.MessageReceived) -> None:
if event.properties.is_sent_carbon:
kind = 'outgoing'
resource_contact = self.contact.get_resource(event.resource)
self.xml.phone_image.set_visible(resource_contact.is_phone)
visible = False
if event.resource is not None:
resource_contact = self.contact.get_resource(event.resource)
visible = resource_contact.is_phone
self.xml.phone_image.set_visible(visible)
self.add_message(event.msgtxt,
kind,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment