diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2024-01-07 16:24:38 +0100 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2024-02-18 11:32:54 +0100 |
commit | ffe13bb8714dbabb983aea314eab753b676773ce (patch) | |
tree | ec5a934da38ae06401256468cbf61acec2a0097a /slack/slack_buffer.py | |
parent | 470f108e64a6dec7b86c7420a58fd889f3425d30 (diff) | |
download | wee-slack-ffe13bb8714dbabb983aea314eab753b676773ce.tar.gz |
Check that buffer_pointer is set before printing/modifying messages
Diffstat (limited to 'slack/slack_buffer.py')
-rw-r--r-- | slack/slack_buffer.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/slack/slack_buffer.py b/slack/slack_buffer.py index eb6f676..ea1ebce 100644 --- a/slack/slack_buffer.py +++ b/slack/slack_buffer.py @@ -62,6 +62,9 @@ def tags_set_notify_none(tags: List[str]) -> List[str]: def modify_buffer_line(buffer_pointer: str, ts: SlackTs, new_text: str): + if not buffer_pointer: + return + own_lines = weechat.hdata_pointer( weechat.hdata_get("buffer"), buffer_pointer, "own_lines" ) @@ -297,6 +300,9 @@ class SlackBuffer(ABC): self.workspace.send_typing(self) async def print_message(self, message: SlackMessage): + if not self.buffer_pointer: + return + rendered = await message.render(self.context) backlog = self.last_read is not None and message.ts <= self.last_read tags = await message.tags(backlog) |