Skip to content

fix: Chat control: Make access to internal contact object more robust

Daniel Brötzmann requested to merge chat-control-contact-object into master

Fixes #12411 (closed)

It looks like _request_history can be called without having a contact object in the control. This is also the case for _on_autoscroll_changed, where this is already caught.

In order to prevent such errors in the future (and allow pyright to hint at this), I replaced all control-internal calls to the contact object with self._contact, and made sure external modules calling control.contact make sure contact is not None (i.e. the control has a chat loaded).

Edited by Daniel Brötzmann

Merge request reports

Loading