Check if channel_buffer exists in reprint_messages
After thread buffers are closed, the instances still remains in
channel.thread_channels, but channel_buffer is set to None.
reprint_messages may be called after this, e.g. on a reconnect.
Therefore, we have to check if channel_buffer is set before calling
buffer_clear.
@@ -1544,6 +1544,7 @@ class SlackChannelCommon(object):
no_log=no_log, extra_tags=extra_tags)
def reprint_messages(self, history_message=False, no_log=True, force_render=False):
+ if self.channel_buffer:
w.buffer_clear(self.channel_buffer)
for message in self.messages.values():
self.prnt_message(message, history_message, no_log, force_render)
