diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2016-03-05 19:49:10 +0100 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2016-03-05 19:52:12 +0100 |
commit | 35b8d5fbe24548b2de9f6700e9849a47129b530b (patch) | |
tree | 106f1d6aaec2544f13fded7b9f740c116f62d9c9 | |
parent | 5946a4a109dcc1474ab53ccc9e2025cb6ed88867 (diff) | |
download | wee-slack-35b8d5fbe24548b2de9f6700e9849a47129b530b.tar.gz |
Don't call buffer_set in im_marked if buffer is None
process_im_marked may be called after process_im_close (e.g. when you do
/close in an im window). After process_im_close has run,
channel.channel_buffer is None, which makes the buffer_set fail.
This fixes #138 and #143.
-rw-r--r-- | wee_slack.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/wee_slack.py b/wee_slack.py index e3df8af..59cf2c6 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -1444,7 +1444,8 @@ def process_im_open(message_json): def process_im_marked(message_json): channel = channels.find(message_json["channel"]) channel.mark_read(False) - w.buffer_set(channel.channel_buffer, "hotlist", "-1") + if channel.channel_buffer is not None: + w.buffer_set(channel.channel_buffer, "hotlist", "-1") def process_im_created(message_json): |