Skip to content

cfix: View: Replace assert by return

mesonium requested to merge mesonium/gajim:view-assertion into master

Fixes assertion error on switching chat, when FT db table contains items:

Traceback (most recent call last):
  File "gajim/gtk/chat_page.py", line 134, in _on_chat_selected
    self._chat_stack.show_chat(account, jid)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
  File "gajim/gtk/chat_stack.py", line 223, in show_chat
    self._chat_control.switch_contact(self._current_contact)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "gajim/gtk/control.py", line 234, in switch_contact
    self._request_history(None, True)
    ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "gajim/gtk/control.py", line 598, in _request_history
    self._add_messages([row])
    ~~~~~~~~~~~~~~~~~~^^^^^^^
  File "gajim/gtk/control.py", line 546, in _add_messages
    self._add_db_row(msg)
    ~~~~~~~~~~~~~~~~^^^^^
  File "gajim/gtk/control.py", line 535, in _add_db_row
    self._scrolled_view.add_jingle_file_transfer(message=message)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "gajim/gtk/conversation/view.py", line 477, in add_jingle_file_transfer
    assert isinstance(self._contact, BareContact)
           ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError

Merge request reports

Loading